I'm new at this, so please forgive me if my question sounds naive. I've been struggling with this issue the whole day.
I'm working on a student project:
https://codepen.io/kremlevmax/pen/EomEyb
Here is the HTML:
<body>
<div class="menu-bar">
<button href="#" class="btn menu-button">Test Button</button>
<button href="#" class="btn menu-button">Test Button</button>
<button href="#" class="btn menu-button">Test Button</button>
</div>
<div class="outer">
<div class="inner">
<div class="container">
<div class="col-lg-3 col-sm-3">
<img src="https://lh3.googleusercontent.com/dB3Dvgf3VIglusoGJAfpNUAANhTXW8K9mvIsiIPkhJUAbAKGKJcEMPTf0mkSexzLM5o=w300" class="portfolio-photo">
</div>
<div class="col-lg-9 col-sm-9 div-photo-text">
<p class="text">
Some test text
</div>
</div>
</div>
</div>
</div>
And the CSS:
body {
background-color: #C0F2FB;
font-family: "Tahoma";
margin: 0;
}
.outer {
background-color: #E8F8FA;
margin: 0 auto;
}
.inner {
background-color: #FFFFFF;
width: 94%;
padding: 20px 20px;
margin: 70px auto;
overflow: hidden;
}
.portfolio-photo {
width: 200px;
border-radius: 50%;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.19);
}
.div-photo-text {
padding: 50%;
text-align: left;
}
.text {
font-size: 120%;
}
.menu-bar {
position: fixed;
overflow: hidden;
top: 0;
width: 100%;
padding: 10px;
background-color: #1A899D;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.menu-button {
float: right;
background-color: #1A899D;
border: 2px solid #1A899D;
color: #C0F2FB;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
}
.menu-button:hover {
background-color: #C0F2FB;
color: #000000;
}
I have a few questions regarding this project:
- Why isn't "Some test text" vertically centered in the div next to the image?
- Why do the picture and text overlap the menu when scrolling instead of going under it?
- If I remove the padding in the div-photo-text class, why does "Some test text" move below the image? Shouldn't the col-lg-3 and col-lg-9 classes keep the text next to the image?
Thank you for any assistance you can provide.