473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting links to not do something

KeredDrahcir
426 Contributor
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 1622
drhowarddrfine
7,435 Recognized Expert Expert
No. This can't be done in CSS.
Jan 11 '12 #2
KeredDrahcir
426 Contributor
Do I have any options?
Jan 11 '12 #3
drhowarddrfine
7,435 Recognized Expert Expert
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 Recognized Expert Moderator MVP
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 Contributor
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 Recognized Expert Expert
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
18841
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 possible solutions and nothing has worked: my html code: <div class="borderCCC"> <div class="clients"><a href="../index.html"><img
14
15839
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. ul.links a:link, ul.links a:visited { color: #FFFFFF; background-color: #000000; } ul.links a:hover, ul.links a:active { color: #FF0000;
10
5380
by: andreister | last post by:
He there! I've discovered that the ================================================= document.links('link_id_here').href = "something"; ================================================= is not applicable for the Firefox (even for the 1.0.6), and I'm falling into passing through the array and checking each link id.
44
9428
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 causes my pages to fail validation (strict doctype). The validator says "There is no attribute 'target'.." So...how do I open a link in a new window, without Javscript, and pass strict validation?
1
6476
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" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
7
17272
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 but the image link stays the same. Anybody know how I can make it work in IE? I saw a web site where the guy got it to work in both browsers. <html> <head> <title>TEST</title>
8
11250
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 HeaderText="Subject" Text="Subject" DataTextField="Subject" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Templates/View.aspx?id={0}" HeaderStyle-CssClass="columnStyle" ItemStyle-CssClass="columnStyle" />
1
1186
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 the screen reader (Jaws) is reading all the links as visited even though none of the links have been visited. Is there a way to set a link to not visited with javascript? Andrew Poulos
7
2974
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 is updating every columns and the where condition is also every column. Is there a setting or something to regenerate the update statement during runtime so that only the changed columns are being updated and the where condition is using the...
0
1814
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 someone clicks on a plus image next to Link1 Link2(lined up with Link1) Link3 (lined up with Link2)
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8535
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...

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.