Skip to navigation

Skip to additional stuff


Tuesday, August 16, 2005

The small things

Recently I’m pretty fascinated of the small things you can design with CSS. Just some smart rules in your stylesheet can create a nice experience for your visitors. Have a look on the left side where you see the feed links. I just can’t get enough of watching how perfectly aligned the words “Full text” are. It looks very nice. I’m really satisfied with what I’ve done there. And it’s so little work to do.

Look at the XHTML:

<ul id="feeds">
<li><a ...><strong>RSS 2.0</strong> Full text</a></li>
<li><a ...><strong>Atom</strong> Full text</a></li>
<li><a ...><strong>RSS 2.0</strong> All comments</a></li>
</ul>


No extra tags, just semantic markup (well, you can argue if you really need the strong, but I need it in that case).

With CSS we apply now some style to it:

#feeds strong {
display: block;
float: left;
width: 50px;
}

We need display: block to make strong a block level element, just that way it can be made 50 px width. float: left is needed to not brake the following text to a new line.

Comparison: Without and with special style

Small, but with effect. Now, one can see that you care even about the small things on your website.

12:33 pm | Filed under: , , , 1 Comment | the j-blog

1 Comment on “The small things”

  • 1.
    Posted by
    Norman
    2005-8-16
    6:53 pm

    I think this is great. I didn’t know that you can do it that way. I will use it soon.

Leave a comment

Your e-mail address will never be displayed.

(required)

(required)



Navigation



© Copyright Julian Bez 2010. All rights reserved, unless otherwise mentioned.
For your convenience: All times are GMT.
Built with valid things such as XHTML and CSS.

PLEASE NOTE: This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. more info...