CSS issue, not sure to use div, id, class, etc.
-
Hi,
I am trying to style a 3 column page layout to my wordpress pages and post through the use of calling up a class (learning CSS and HTML as I go so please bear with my terminology and redundancy in code.)
The CSS I have so far is this:
p.column1, p.column2, p.column3{
float: left;
width:30%;
}p.column1 {
background-color: transparent;
background: url(‘themes/images/bgback1.jpg’) no-repeat top;
background-attachment: scroll;
background-x-position: 0%;
background-y-position: 0%;
background-repeat: no-repeat;
width: 115px;
margin-top: auto;
margin-right: 45px;
margin-bottom: auto;
margin-left: auto;
padding-left: 10px;
padding-right: 20px;
padding-top: 0px;
padding-bottom: 10px;
}p.column2 {
background-color: transparent;
background: url(‘themes/images/bgback.jpg’) no-repeat top;
background-attachment: scroll;
background-x-position: 0%;
background-y-position: 0%;
background-repeat: no-repeat;
width: 115px;
margin-top: auto;
margin-right: 45px;
margin-bottom: auto;
margin-left: auto;
padding-left: 10px;
padding-right: 20px;
padding-top: 0px;
padding-bottom: 10px;
}p.column3 {
background-color: transparent;
background: url(‘themes/images/bgback.jpg’) no-repeat top;
background-attachment: scroll;
background-x-position: 0%;
background-y-position: 0%;
background-repeat: no-repeat;
width: 115px;
margin-top: auto;
margin-right: 0px;
margin-bottom: auto;
margin-left: auto;
padding-left: 10px;
padding-right: 20px;
padding-top: 0px;
padding-bottom: 10px;
}The HTML I enter is as follows:
<p class=”column1″>What To Buy
Pink or Blue Widgets. Pink or blue widgets. Pink or Blue widgets.
Learn More</p><p class=”column2″> How To Buy
Some tips and deals. Some tips and deals. Some tips and deals.
Learn More</p><p class=”column3″> How To Use
How to use your pink and blue widgets
Learn More</p>Questions:
The layout looks good (padding and margin) but I am not sure how to style each of the text independently, example would like the “How To…” to be bold. The middle section to be smaller text and a different color. And the bottom “Learn More” text to be styled another way. As right now it is defaulting to the “.p” css style for all the text withing this.
Not sure what sort of selector I should be using for the css. Also not sure how to style a class within a class, if that is even possible.
Hope someone can help me out here. thanks again.
- The topic ‘CSS issue, not sure to use div, id, class, etc.’ is closed to new replies.