2 replies [Last post]
gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 46 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Hey guys i recetly saw a CSS only slider and decided to make a simple version of it myself , i succeeded , but i have a problem understanding the code .

the following is my code :

HTML :

 

CSS code :

 

my question is pertaining to this little piece of CSS code .

ul li{
	/*position: relative;*/
	width: 20%;
	overflow: hidden;
	float: left;
	height: 100%;
}

the width: 20% , works but i don't get what really it is doing ?? :/

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 31 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

It's doing what it's saying

It's doing what it's saying making all li elements in a global sense 20% wide, and in a global sense that is a bad bit of code, however I'm guessing you have presented that snippet out of context which isn't going to help us understand what's what.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 46 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Hugo

Thanks . i forgot to paste the code , anyways , figured it out . cheers . Party