Jump to content


css question/problem


5 replies to this topic

#1 Nightscream

    Young Padawan

  • Members
  • Pip
  • 100 posts
  • Gender:Male
  • Location:Belgium

Posted 07 December 2006 - 02:19 PM

Don't really knew where to post this cause i didn't saw a html/css section.
But my question/problem is I have a layer website
and in my menu i'm using buttons, <ul><li>
but I give the li a special id, the top one is <il id="head"> and it has another background-image as the other one but how can i put my text in the middle of it and set padding on it cause when i do some padding i get troubles :S

I hope you understand
ty in advance

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 07 December 2006 - 04:24 PM

You will have to give us a link/example of your problem and code so we can actually give you any information on how to fix it.

#3 Nightscream

    Young Padawan

  • Members
  • Pip
  • 100 posts
  • Gender:Male
  • Location:Belgium

Posted 07 December 2006 - 06:17 PM

ok this is just a piece of the code but i think that's all you need

this is the html
<div id="sidebar">
		<div id="leftnav">
			<img src="images/deimon_network.gif" width="173" height="25" />
			<ul>
				<li id="head">+ link</li>
				<li id="button">+ link</li>
				<li id="button">+ link</li>
				<li id="foot"></li>
			</ul>
		</div>
</div>

this the css
#sidebar {
	float: left;
	width: 173px;
}
#sidebar #leftnav {
	width: 173px;
	overflow: hidden;
}
#sidebar #leftnav ul {
	list-style: none;
	width: 173px;
	display: block;
	margin: 0 0 0 0;
	padding: 0 0 0 0;
	overflow: hidden;
}
#sidebar #leftnav #head {
	width: 173px;
	height: 27px;
	background-image: url(images/nav_head.gif);
	background-repeat: no-repeat;
}
#sidebar #leftnav #button {
	width: 173px;
	height: 20px;
	background-image: url(images/nav_but.gif);
	background-repeat: no-repeat;
}
#sidebar #leftnav #foot {
	width: 173px;
	height: 20px;
	background-image: url(images/nav_foot.gif);
}

ty in advance
-- Nighstcream --

#4 Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 08 December 2006 - 03:09 PM

When you use an id it's supposed to be used only once per page. If you want to use something multiple times on a page make it a class. So for example, your button should be a class:

#sidebar #leftnav .button {
	width: 173px;
	height: 20px;
	background-image: url(images/nav_but.gif);
	background-repeat: no-repeat;
}

<li class="button">+ link</li>


#5 Nightscream

    Young Padawan

  • Members
  • Pip
  • 100 posts
  • Gender:Male
  • Location:Belgium

Posted 08 December 2006 - 04:30 PM

are you sure, it's in a stylesheet
and btw i need to get my text in the middle and with a little padding
but when i do so, my background of that ul just doesn't look good, it's moves

Edited by Nightscream, 08 December 2006 - 04:32 PM.


#6 Nightscream

    Young Padawan

  • Members
  • Pip
  • 100 posts
  • Gender:Male
  • Location:Belgium

Posted 12 December 2006 - 03:52 PM

Never mind, i fixed it





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users