473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Setting links to not do something

KeredDrahcir
426 256MB
I have some list items and in some cases I want to display a link inside the list
Expand|Select|Wrap|Line Numbers
  1. <ul class="list_name">
  2.   <li><a href=""></a></li>
  3.   <li><a href=""></a></li>
  4.   <li></li>
  5. </ul>
On the list items I'm using
Expand|Select|Wrap|Line Numbers
  1. .list_name li{
  2.   padding-top: 7px;
  3. }
to set padding. To style the linked ones I'm using
Expand|Select|Wrap|Line Numbers
  1. .last_name li a{
  2. }
Is there anyway to set it not to have the padding on the links?
Jan 11 '12 #1
6 1617
drhowarddrfine
7,435 Expert 4TB
No. This can't be done in CSS.
Jan 11 '12 #2
KeredDrahcir
426 256MB
Do I have any options?
Jan 11 '12 #3
drhowarddrfine
7,435 Expert 4TB
I was going to suggest adding the padding or margin to the anchor. If the anchor is not present, then nothing will happen.

Of course, there's always javascript.
Jan 11 '12 #4
Rabbit
12,516 Expert Mod 8TB
I suppose you could give each of the list items a class depending on whether or not it had an anchor and do it that way.
Jan 11 '12 #5
KeredDrahcir
426 256MB
Thanks Rabbit. I was thinking of doing that.

Your suggestion is what I did drhowarddrfine but I don't want the padding on the links. I want it on the list items that don't have links.
Jan 12 '12 #6
drhowarddrfine
7,435 Expert 4TB
I didn't know that was an option. You can look into the 'not:' selector but it only works in modern browsers and IE9.
Jan 12 '12 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MediaDesign | last post by:
so there's the problem: my text links have background images and when I put links around images on my page, they too get the background image treatment which I do not...I have tried several...
14
by: Philip Herlihy | last post by:
I've been trying to create a simple vertical navigation bar, using (as recommended) an unordered list (UL) of hyperlinks. I'd like to have a hover effect, so I have to style the links themselves....
10
by: andreister | last post by:
He there! I've discovered that the ================================================= document.links('link_id_here').href = "something"; ================================================= is...
44
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
7
by: Cate Archer | last post by:
I want to have a border around an image that changes color when the mouse hovers over it. The following code works perfectly in FireFox but not in Internet Exploiter. The text link changes color...
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
1
by: Andrew Poulos | last post by:
To add some accessibility to the output of a 3rd party product I'm writing some javascript. Specifically, I'm highlighting links on focus with a yellow border. This is working fine except that...
7
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm not sure whether I'm missing something or not. I reviewed the SQL Statements generated by tableadapter when the selectcommand is select *. It seems they are extremely bad. The updatecommand...
0
by: Peter Horlock | last post by:
Hi, Using css (that should be working in Firefox 2,3 and Internet Explorer 6,7 at least), I would like to create the following: My Links: Link1 +show more links <!--- This is shown when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.