|
|
Tip#4Cascading Style Sheets, CSS Tricks: IndentingAs designers, we are loath to give up control over spacing and layout in our Web pages. This desire for a certain look-and-feel often leads us to omit proper structural markup where it is needed, or to use HTML improperly to achieve a certain visual effect at the expense of accessibility. Commonly misused HTML elements include:
Commonly omitted HTML elements include:
Improper or inadequate use of structural markup can confound assistive technologies used by disabled people. It also makes your pages non-portable, bloated, and difficult to maintain. "But, but, but..."Hang on, I know you don't want to sacrifice design for accessibility. And you don't have to. Fortunately, the same precise presentational effects can nearly always be achieved without misusing HTML tags or making the page hard for disabled visitors to use. The solution is Cascading Style Sheets, CSS. IndentingQuestion: I want certain images and blocks of text on my page to be indented. How do I do this without using tables, BLOCKQUOTE, or DL? With Cascading Style Sheets, CSS you can achieve this effect cleanly, and you will have more precise control over the amount of indentation. Create a class in your Cascading Style Sheets "stylesheet" like this: .indent {margin-left: 2.5em} You can use different measurements according to your needs. Play around with different values until you get the effect you want, and don't forget to test on multiple platforms and browsers. You can define your styles either in a single, separate style sheets (recommended), or between the HEAD tags of individual pages, like so: <head>
|
||||||||||||||||||
Copyright ©2005 webmastersprofitpak.net. All rights reserved.