-
Published on :
05
January
10
-
by :
-
in :
Web development
-
Comments :
0 Comments
Inline elements and padding :
“Have you ever tried to add padding toelements that have been set to ‘display: inline’? Did you find that the padding seemed to be rendering in an unusual way? … To understand why this is happening, we need to look at the different ways that block level and inline elements treat properties such as width, height, padding and margins.” For example, the W3C states that the width, height properties do not apply to inline, non-replaced elements, but line-heightdoes apply to the height of the box. Read Russ Weakley’s presentation to understand more of what does and doesn’t apply and how you can achieve the results you need for your inline list navigation or other inline elements. Fabulous presentation that explains things in an easy-to-understand way.
Turning a list into a navigation bar :
Fabulous tutorial with easy-to-understand instructions and packed with code samples all along the way explaining how to create a horizontal navigation bar using CSS and HTML unordered list item elements, CSS floats, and much more. Explains all the basics but also adds nice touches such as transforming the text to uppercase, adding a drop shadow using CSS, more. Great tips here.
-
Published on :
09
November
09
-
by :
-
in :
Web development
-
Comments :
0 Comments
Thus far, we have only shown you how to use CSS the way it was meant to be used — separated from the HTML. However, it is possible to place CSS right in the thick of your HTML code, and this method of CSS usage is referred to as inline css.
Inline CSS has the highest priority out of external, internal, and inline CSS. This means that you can override styles that are defined in external or internal by using inline CSS. However, inline CSS detracts from the true purpose of CSS, so use it sparingly.
Believe it or not, CSS is built in to every HTML tag. If you want to add a style inside an HTML element all you have to do is specify the desired CSS properties with the style HTML attribute. Let’s add some style to a paragraph tag.