Z Title
Some text afterwards
As you can see, the box floats to the right side of this text. As with images, be sure to use padding if your text is running right into your bordered divs.
The div box is a container which can hold other html items within it. In fact, it is used by most modern WordPress themes to display different sections of pages.
If you have a large display, resize your window a few times and see how the divs react. They can be a bit erratic and hard to get just right when you first start using them…at least on large display areas.
However, if you have a maximum width or fixed width set for your page, then this becomes a lot less problematic.
You can place images inside of divs to help position them a bit more reliably.
You can also use styled divs ( or even styled paragraph tags ) for callouts:
A Styled Paragraph Callout
The above paragraph uses the following styles:
- text-align: center;
- border: 1px solid #000;
- font-weight: bold;
- color: #D00;
- background-color: #EEE
The #XXX notation is shorthand for #RRGGBB, which each single digit being repeated so #FFF stands for #FFFFFF.
And again, you could create a class so that you only had to enter class="whatever" rather than each style attribute every time.
.whatever {
text-align: center;
border: 1px solid #000;
font-weight: bold;
color: #D00;
background-color: #EEE;
}
That is how you would add such a style to your style sheet or CSS Insert.
|