[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ul li a text-indent not working

Posted on 2009-04-13
1
Medium Priority
?
2,004 Views
Last Modified: 2013-11-19
Trying to replace text with a background image in CSS - I'm assuming the fact that my list is display:inline could be causing the issue

Does anyone know how to fix this?


#header{
	margin: 0;
	padding: 0;
	height: 85px;
	width: 100%;
	text-indent: -9000px;
}
#header ul {
	margin: 0;
	padding: 0;
	width: 540px;
	list-style: none;
	display: inline;
}
#header ul li {
	margin: 0;
	padding: 0;
	width: 175px;
	height: 40px;
	display: inline;
}
#header ul li a.home{
	width: 92px;
	height: 32px;
	font-size: 33px;
	background: #fff url('../images/sprite.gif') 0px 0px no-repeat;
}
#header ul li a.services{
	width: 105px;
	height: 32px;
	font-size: 33px;
	background: #fff url('../images/sprite.gif') -105px 0px no-repeat;
}
#header ul li a.aboutUs{
	width: 150px;
	height: 32px;
	font-size: 33px;
	background: #fff url('../images/sprite.gif') -255px 0px no-repeat;
}
#header ul li a.contactUs{
	width: 160px;
	height: 32px;
	font-size: 33px;
	background: #fff url('../images/sprite.gif') -410px 0px no-repeat;
}
 
 
==============
 
 
		<div id="header">
			<ul>
				<li><a class="home" href="index.php">Home</a></li>
				<li><a class="services" href="services.php">Services</a></li>
				<li><a class="aboutUs" href="aboutUs.php">About Us</a></li>
				<li><a class="contactUs" href="contactUs.php">Contact Us</a></li>
			</ul>
		</div>

Open in new window

0
Comment
Question by:trickyidiot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 43

Accepted Solution

by:
David S. earned 2000 total points
ID: 24134805
The width and height properties don't apply to (non-floated, non-absolutely-positioned) elements with display:inline. Those <a>s need display:block

What happens if a visitor has images disabled in their browser? I use and recommend the Gilder/Levin Method of CSS Image Replacement: http://levin.grundeis.net/files/20030809/alternatefir.html
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question