Adam
asked on
I can't get my CSS class to work as I want (I'm a beginner)
Hi. I'm trying to re-use a bit of code on my site but am struggling to get it to do what I'd like it to do. I want to have a semi transparent white background around my text for a new section ID on my homepage. It's working for the Header section ID - with the following set up in the CSS styles file:
I think this is a class of the section ID header , which has the following criteria set up in the CSS styles file:
It is implemented in the HTML like this:
I want to create the same thing for my contact section ID
I have set up the following in the CSS Style Sheet:
And I tried to implement in the HTML like this:
But it doesn't work and I don't get the background around the text (I don't get anything). Is there something obvious I'm not doing correctly? I've been playing around with it for three hours now and can't seem to configure it correctly.
Any help would be greatly appreciated.
Many thanks.
#header .header-left{
background:rgba(255,255,255,0.5);
padding-top:30px;
margin-top:80px;
border-radius:10px;
}
I think this is a class of the section ID header , which has the following criteria set up in the CSS styles file:
#header{
background:url('../img/frontimage.jpg') center center no-repeat;
background-size:cover; /*used to cover the entire page*/
height:100%;
color:#000000;
display:flex;
align-items:right;
}
It is implemented in the HTML like this:
<div class="col-md-6 header-left">
<h1>Orangutan Japan</h1>
<br />
<h4>Teach English in Japan</h4>
</div>
I want to create the same thing for my contact section ID
I have set up the following in the CSS Style Sheet:
/*CONTACT*/
#contact{
background:url('../img/people.jpg') center center no-repeat;/*Image we display in the header - top part of the webapge*/
background-size:cover; /*used to cover the entire page*/
height:100%;
color:#000000;
display:flex;
align-items:center;
padding:5rem 0;
}
#contact .boxy{
background:rgba(255,255,255,0.5);
padding-top:30px;
margin-top:80px;
border-radius:10px;
}
And I tried to implement in the HTML like this:
<div class="container text-xs-center">
<div class ="row">
<div class ="col-md-12 boxy">
<h1>Contact Us</h1>
<hr width="30%">
<br><br>
<h1><a href="contact.php">Get in touch</a></h1>
<p><a href="contact.php">Contact us at OrangutanJapan</a></p>
</div>
</div>
</div><!--end the container -->
</section>
But it doesn't work and I don't get the background around the text (I don't get anything). Is there something obvious I'm not doing correctly? I've been playing around with it for three hours now and can't seem to configure it correctly.
Any help would be greatly appreciated.
Many thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks Scott. Worked just as you said.
Thanks.
Thanks.
ASKER