So please forgive me, I am very new to CSS, this is my first real project and I'm having some issue with the p
being pushed slightly off center by the float:left
element of my second img
.
Here is my HTML
<div>
<img id="fishnchips" src="image1.jpeg" alt="Fish n Chips">
<img id="chicken" src="Friedchickenredbasket.jpeg" alt="Chicken Basket">
</div>
<!--End of images-->
<div class="header-p">
<p>Coming Soon!</p>
</div>
</header>
<p><div id="address">123 Main St.</div></p>
I have tried wrapping both images in a div by themselves, that didn't work. I tried putting the img
inside the .header
-p. That also didn't work.
The commented part is another fix I tried which also didn't work. This is the only way I have been able to get the top image #fishnchips
to be on the top left but with a slight padding in the left margin, while the image below it #chicken
is slightly underneath the top image, also on the left side. What I want is for the paragraph to be centered, and not have the float:left
push it slightly off center.
When I tested it, if I remove float:left
, the "Coming Soon!" and the address both go back into the correct place. However I've not found an alternate to float:left
that can make the image stay on the left side of the screen only using css.
Here is my CSS:
#fishnchips {
position: fixed;
top: 25px;
left: 25px;
right: 10px;
height: 20%;
float: left;
margin-left: 0px;
}
#chicken {
/* position: fixed;
top: 25px;
left: px;
right: 10px;
height: 40%;
float: left;
margin-left: 0px;*/
margin-top: 40px;
height: 10%;
width: 20%;
right: 0;
float: left;
clear: both;
display: inline-block;
}
.header-p {
font-family: 'Permanent Marker', cursive;
font-size: 50px;
text-align: center;
padding-top: .01 em;
}
#address {
color: #410101;
font-weight: 200;
font-size: 1.5em;
}