Text indent not working with anchor tags


Corinem

http://jsfiddle.net/corinem/TtPgy/

I am using:

<a href="">Lorem ipsum dolor.</a>

CSS:

a{text-indent:-9999px;}

...but that doesn't work. For example <p>, it works when I do it with another tab .

I also tried adding overflow:hiddenCSS but it still doesn't work. I think there is a conceptual error with this CSS property.

Chris Bedoya

As other answers have suggested, you can only apply to text-indent: -9999pxblock elements. You can use display: inline-blockor display: block;and it will work.

I also recommend using

text-indent: 100%;
white-space: nowrap;
overflow: hidden;

Not text-indent: -9999px;because -9999px forces the browser to create 9999px boxes offscreen. Learn more about this "hack" here : http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/

Related


Some tags in anchor tag, text indent not working

Rajaseca I created the label inside the label and applied the indent text: -9999px; but it doesn't work To be ADA compliant we need to add (new window) text in the anchor tag, but I don't want that text to be displayed so I used text-indent HTML: <a href="#" t

Some tags in anchor tag, text indent not working

Rajaseca I created the label inside the label and applied the indent text: -9999px; but it doesn't work To be ADA compliant we need to add (new window) text in the anchor tag, but I don't want that text to be displayed so I used text-indent HTML: <a href="#" t

Anchor tags not working in fancybox

username When I click "LOGOUT" I want to logout (redirect to logout page). <div id="emailverification" style="display:none;"> <div style="width: 100%;float:left;background-color: #E4E5EA;"> $(document).ready(function () { $("#emailverification").fancybox(

Why is text indent not working?

User 9757285 I want to indent the first line of text in each paragraph p3 { display: inline; text-indent: 50px; font-family: Helvetica, serif; font-size: 30px; font-weight: 100; margin-top: 40px; } selence Ignoring your issue with invalid selector

Anchor tags not working on laravel 5.2

Azario Times I wouldn't make direct pages with anchor tags in blade template engine, but it doesn't work. _sidebar.blade.php <li class="active treeview"> <a href="{{ url('/') }}"> <i class="fa fa-dashboard"></i> <span>Menu Utama</span> </a>

Animation not working on all anchor tags

Barwick I'm having a problem with the arrow animation on hover of an anchor tag. When I hover over the first Anchor label animation it works fine and changes the style using JavaScript. But the problem is when I use multiple Anchor tags, it only works perfectl

My anchor tags are not working.

Froy The problem is that as stated in the title, clicking on an image wrapped with an anchor tag doesn't work. Here is an example of a grid list item: <li class="grid-list-item"> <h3 class="grid-trail-name">Marshall Canyon</h3><span class="grid-loc

Anchor tags not working on laravel 5.2

Azario Times I wouldn't make direct pages with anchor tags in blade template engine, but it doesn't work. _sidebar.blade.php <li class="active treeview"> <a href="{{ url('/') }}"> <i class="fa fa-dashboard"></i> <span>Menu Utama</span> </a>

Animation not working on all anchor tags

Barwick I'm having a problem with the arrow animation on hover of an anchor tag. When I hover over the first Anchor label animation it works fine and changes the style using JavaScript. But the problem is when I use multiple Anchor tags, it only works perfectl

CSS styles for anchor tags not working

Turbo 123 I put some links on the page, added the link to a css file to the html, but the styles are not showing. HTML: <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="te

Animation not working on all anchor tags

Barwick I'm having a problem with the arrow animation on hover of an anchor tag. When I hover over the first Anchor label animation it works fine and changes the style using JavaScript. But the problem is when I use multiple Anchor tags, it only works perfectl

Anchor tags not working on laravel 5.2

Azario Times I wouldn't make direct pages with anchor tags in blade template engine, but it doesn't work. _sidebar.blade.php <li class="active treeview"> <a href="{{ url('/') }}"> <i class="fa fa-dashboard"></i> <span>Menu Utama</span> </a>

Anchor tags not working on laravel 5.2

Azario Times I wouldn't make direct pages with anchor tags in blade template engine, but it doesn't work. _sidebar.blade.php <li class="active treeview"> <a href="{{ url('/') }}"> <i class="fa fa-dashboard"></i> <span>Menu Utama</span> </a>

Animation not working on all anchor tags

Barwick I'm having a problem with the arrow animation on hover of an anchor tag. When I hover over the first Anchor label animation it works fine and changes the style using JavaScript. But the problem is when I use multiple Anchor tags, it only works perfectl

Animation not working on all anchor tags

Barwick I'm having a problem with the arrow animation on hover of an anchor tag. When I hover over the first Anchor label animation it works fine and changes the style using JavaScript. But the problem is when I use multiple Anchor tags, it only works perfectl

Replace DOM text with anchor tags

virtual logic I am searching the html body, but the markup is displayed in plain text. How can I correct the anchor to replace John with the name as well as the link to show the clickable anchor. Can the replacement of search terms be solved in javascript? Inc

Center text and icons in anchor tags

Xu Wu I am a beginner in web development. I want to make a button with a text and an icon on two separate lines. Since the buttons are rectangular, I want the text and icons to be centered vertically and horizontally to make them look nice. what should I do? T

Replace DOM text with anchor tags

virtual logic I am searching the html body, but the markup is displayed in plain text. How can I correct the anchor to replace John with the name as well as the link to show the clickable anchor. Can the replacement of search terms be solved in javascript? Inc

Replace DOM text with anchor tags

virtual logic I am searching the html body, but the markup is displayed in plain text. How can I correct the anchor to replace John with the name as well as the link to show the clickable anchor. Can the replacement of search terms be solved in javascript? Inc

Replace DOM text with anchor tags

virtual logic I am searching the html body, but the markup is displayed in plain text. How can I correct the anchor to replace John with the name as well as the link to show the clickable anchor. Can the replacement of search terms be solved in javascript? Inc

Replace DOM text with anchor tags

virtual logic I am searching the html body, but the markup is displayed in plain text. How can I correct the anchor to replace John with the name as well as the link to show the clickable anchor. Can the replacement of search terms be solved in javascript? Inc

Anchor tags in chrome not working properly? Is this a chrome bug?

Owen I have a website http://rethinkwaste.com.au/ . When the first slide is clicked, I set an anchor <div id="illegal"></div> This seems to jump back to the top of the page on first load in google chrome. Is this a Chrome bug? If I then refresh or load the pa

Subsequent anchor tags not working in html/php

Bishwaroop Chakraborty I'm trying to alert each user's personal id in a html user link. So each user will be fetched from the database and displayed on the page as a link. Also, since they have a unique email id, I'm trying to alert that user to their email wh

Anchor tags are not working properly in my Laravel website

Arafat Rahman On my Laravel website, I want to link my Facebook account with the website, but it's not working. if i am using <a href="{{url('/www.facebook.com/my_fb_page_id')}}"></a> For this, the link appears as follows https://myDomainName/www.facebook.com

Anchor tags are not working properly in my Laravel website

Arafat Rahman On my Laravel website, I want to link my Facebook account with the website, but it's not working. if i am using <a href="{{url('/www.facebook.com/my_fb_page_id')}}"></a> For this, the link appears as follows https://myDomainName/www.facebook.com

Javascript dynamic creation of anchor tags g not working

Ankita Kashyap I am trying to create html using javascript. But my links to anchor tags are not working. var test ="http://blogs.edweek.org/edweek/finding_common_ground/2016/10/if_coaching_is_so_powerful_why_are't_principals_being_coached.html?cmp=SOC-EDIT-F

BeautifulSoup: Extract text from anchor tags

Add a semicolon: I want to extract: the text from imagethe tag's src and divThe text of the anchor tag within the class data I successfully extracted the img src, but I'm having trouble extracting the text from the anchor tag. <a class="title" href="http://www

BeautifulSoup: Extract text from anchor tags

Add a semicolon: I want to extract: the text from imagethe tag's src and divThe text of the anchor tag within the class data I successfully extracted the img src, but I'm having trouble extracting the text from the anchor tag. <a class="title" href="http://www

Select li tags with specific anchor tag text

Wald Navid I have the following code: <ul id="ulId"> <div> <div> <li class="cModel" style=""><a href="#">4RUNNER</a></li> <li class="cModel" style=""><a href="#">86</a></li> <li class="cModel" style=""><a href