RedRunner
Member
Posted 1 year ago #
Hi all,
I writing a page template and am having trouble getting two div-classes I've called 'col-left' and 'col-right' to appear beside each other, rather than one on top of the other.
In the CSS I've currently got:
col-left
{
float:left;
margin-right:10px;
width:48%;
}
}
col-right
{
float:left;
width:48%;
}
But it's just not being picked up!! My parent theme is TwentyTen.
Any help would be really appreciated.
Thanks!
.col-left { ... }
styles for css class start with a dot . in the style sheet
(for css id they start with #)
RedRunner
Member
Posted 1 year ago #
Thanks very much,
Though still not working. I think I haven't correctly written the div id/class in the html so it's not being recognised in the css.
The html looks like:
<div id="col-left">
<h4 class="#C22828">INSERT TEXT</h4>
Should it be <div class="col-left">
Or is this all wrongs... sorry - beginner coder here!
if you are using:
<div id="col-left">
the style is:
#col-left { ... }
for:
<div class="col-left">
the style is:
.col-left { ... }
there is no difference on how these are shown in the browser; however, for other reasons, a css id should only be used once in a page; while a css class can be used many times.
RedRunner
Member
Posted 1 year ago #
Perfect! Solved.
Thanks so much!