#1 (permalink)  
Old 04-06-2007, 10:44 AM
halotree's Avatar
halotree halotree is offline
New In Town
 
Join Date: Apr 2007
Posts: 66
iTrader: (0)
halotree is on a distinguished road
Default Efficient CSS!

I have a task on my hands, and that is to help everyone try and learn efficient CSS and XHTML for their websites, I am going to show you how to create a perfect navigation:

HTML
Code:
<ul>
<li><a href="#"><img src="images/image.png" alt="Link" /></a></li>
<li><a href="#"><img src="images/image.png" alt="Link" /></a></li>
<li><a href="#"><img src="images/image.png" alt="Link" /></a></li>
<li><a href="#"><img src="images/image.png" alt="Link" /></a></li>
<li><a href="#"><img src="images/image.png" alt="Link" /></a></li>
</ul>
CSS ...the clever bit
Code:
li {
list-style: none;
list-style-position:inside;
display: inline;
}
..thats the easy bit now if you want to add rollovers...

HTML
Code:
<ul>
<a href="#"><li id="nav1"></li></a>
</ul>
CSS
Code:
li.nav1{
background: url(image/norm.png) no-repeat;
}
li.nav1 a:hover{
background: url(image/roll.png) no-repeat;
}

maybe someone learnt something I dont know..
Alex
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-07-2007, 12:21 AM
mtajim mtajim is offline
Member
 
Join Date: Mar 2007
Posts: 308
iTrader: (0)
mtajim is on a distinguished road
Send a message via MSN to mtajim Send a message via Yahoo to mtajim
Default

One thing i saw in your code , you are using .png image files , My dear friend - many browsers today still cannot render png files , so for effieient css use jpg files.
Reply With Quote
  #3 (permalink)  
Old 04-07-2007, 01:02 AM
halotree's Avatar
halotree halotree is offline
New In Town
 
Join Date: Apr 2007
Posts: 66
iTrader: (0)
halotree is on a distinguished road
Default

thanks for the hands up, which browsers dont support .png ?
Would be using another optimised format such as .gif be ok?
Alex
Reply With Quote
  #4 (permalink)  
Old 04-07-2007, 11:43 PM
mtajim mtajim is offline
Member
 
Join Date: Mar 2007
Posts: 308
iTrader: (0)
mtajim is on a distinguished road
Send a message via MSN to mtajim Send a message via Yahoo to mtajim
Default

still IE cannot render png , maybe the newer one can but still the older version which is used by many people is not able to render png
Reply With Quote
  #5 (permalink)  
Old 04-08-2007, 07:48 PM
capty99 capty99 is offline
New In Town
 
Join Date: Apr 2007
Location: austin, texas
Posts: 33
iTrader: (0)
capty99 is on a distinguished road
Send a message via AIM to capty99
Default

Quote:
Originally Posted by mtajim View Post
still IE cannot render png , maybe the newer one can but still the older version which is used by many people is not able to render png

yeah, just a qualification of that.

IE 7 renders png's but still experiences a problem every once in a while. The thing about png in ie 6 is it will render any pixels that are not completely opaque as transparent. So, if you have any kind of transparency in your image your pretty much screwed.

I never knew that until i just checked it out here :
PNG: Current Status

kinda interesting.
__________________
======================
Tyler James Lee
aim : tyler james lee
email : tyler@tylerjameslee.com
site : tylerjameslee.com
======================
Reply With Quote
  #6 (permalink)  
Old 04-09-2007, 12:04 AM
mtajim mtajim is offline
Member
 
Join Date: Mar 2007
Posts: 308
iTrader: (0)
mtajim is on a distinguished road
Send a message via MSN to mtajim Send a message via Yahoo to mtajim
Default

thats right , png is supposed to be coming later in years , but still the latest browsers have not accepted its use
Reply With Quote
  #7 (permalink)  
Old 05-05-2007, 03:27 PM
Kiaesi Kiaesi is offline
New In Town
 
Join Date: May 2007
Posts: 30
iTrader: (0)
Kiaesi is on a distinguished road
Default

Thanks for the tips im looking to try and learn CSS as i want to try and build a site using it. At the moment i only know html so CSS will be a stretch but i will look more at what you have wrote and see if i can develop a understanding of some kind :).
Reply With Quote
  #8 (permalink)  
Old 05-29-2007, 01:05 PM
Fizz Fizz is offline
New In Town
 
Join Date: May 2007
Posts: 29
iTrader: (0)
Fizz is on a distinguished road
Default

Listen to the wise mtajim! Efficient CSS requires browser support. You can put in code that will work in new browsers, but DO NOT forget older browsers.


Kiaesi, once you learn CSS you will wonder how you lived without it. Please don't do what I did when I was trying to learn though. I over complicated it and really it's not that hard, pretty easy actually. Good luck to you.
Reply With Quote
  #9 (permalink)  
Old 08-01-2007, 12:36 PM
RichardJohn RichardJohn is offline
New In Town
 
Join Date: Aug 2007
Posts: 1
iTrader: (0)
RichardJohn is on a distinguished road
Default

PNGs DO work in IE, but transparency is screwed in earlier versions.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 10:33 PM.
vBSkinworks


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. © FreelanceGossip.com