Reputation: 135
When I write this, the word Hello appears in the top of my page instead of the bottom:
<footer> Hello </footer>
Here is the important part of my CSS file:
.footer{
position:fixed;
bottom:0;
left:0;
height:100px;
background: black;
}
I really don't know what's wrong. I'm working under Ruby on Rails, and I'm using Pdfkit to transform my html page into pdf, but I don't think this matters.
Upvotes: 3
Views: 3270
Reputation: 3351
In CSS replace .footer
with footer
and it will work and the working fiddle is here
And just for your clarification.
In html we create tags and some of them have attributes like class
and id
. And below shows how you can assign CSS.
if class
is attribute then you use the .
<div class="new"/>
CSS would be
.new{}
if attribute is id
then you use #
<div id="new"/>
CSS would be
#new{}
if css is directly on tag with no attriutes, directly use the tag. (This is where you were getting stuck)
<div/>
CSS would be
div{}
happy coding!!!!
Upvotes: 3