Forum Statistics

  • Forum Members: 4,499
  • Total Threads: 3,656
  • Total Posts: 11
There are 1 users currently browsing forums.

Partner Sites

Reply
Old 04-06-2007, 10:44 AM   #1 (permalink)
 
halotree's Avatar
 
Status: FG Regular
Join Date: Apr 2007
Posts: 66

Rep Power: 27 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
halotree is offline Add Infraction for halotree   Reply With Quote
Old 04-07-2007, 12:21 AM   #2 (permalink)
 
Status: People Love Me
Join Date: Mar 2007
Posts: 308

Rep Power: 52 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.
mtajim is offline Add Infraction for mtajim   Reply With Quote
Old 04-07-2007, 01:02 AM   #3 (permalink)
 
halotree's Avatar
 
Status: FG Regular
Join Date: Apr 2007
Posts: 66

Rep Power: 27 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
halotree is offline Add Infraction for halotree   Reply With Quote
Old 04-07-2007, 11:43 PM   #4 (permalink)
 
Status: People Love Me
Join Date: Mar 2007
Posts: 308

Rep Power: 52 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
mtajim is offline Add Infraction for mtajim   Reply With Quote
Old 04-08-2007, 07:48 PM   #5 (permalink)
 
Status: On a mission
Join Date: Apr 2007
Location: austin, texas
Posts: 33

Rep Power: 24 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
======================
capty99 is offline Add Infraction for capty99   Reply With Quote
Old 04-09-2007, 12:04 AM   #6 (permalink)
 
Status: People Love Me
Join Date: Mar 2007
Posts: 308

Rep Power: 52 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
mtajim is offline Add Infraction for mtajim   Reply With Quote
Old 05-05-2007, 03:27 PM   #7 (permalink)
 
Status: On a mission
Join Date: May 2007
Posts: 30

Rep Power: 24 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 .
Kiaesi is offline Add Infraction for Kiaesi   Reply With Quote
Old 05-29-2007, 01:05 PM   #8 (permalink)
 
Status: On a mission
Join Date: May 2007
Posts: 29

Rep Power: 23 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.
Fizz is offline Add Infraction for Fizz   Reply With Quote
Old 08-01-2007, 12:36 PM   #9 (permalink)
 
Status: Newbie
Join Date: Aug 2007
Posts: 1

Rep Power: 20 RichardJohn is on a distinguished road



Default

PNGs DO work in IE, but transparency is screwed in earlier versions.
RichardJohn is offline Add Infraction for RichardJohn   Reply With Quote
Old 07-23-2011, 07:48 PM   #10 (permalink)
diannamori
 
Status: Guest
Posts: n/a



Default

thanks for this code I am trying to interstand what u write in code
hehehehe
  Edit/Delete Message Reply With Quote


Reply

Bookmarks

Tags
None


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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


Search Engine Optimization by vBSEO 3.5.0 RC2