Welcome Guest, Not a member yet? Register   Sign In
How to give style to anchor()?
#1

[eluser]antoniog[/eluser]
I'm trying to remove the underscore line typical of the anchors through the CSS.
I still put the DIV by setting it as a class, but even though I set "text-decoration: none;" as in the following piece of CSS code, the line remains.
Does anyone know if you can get the result and explain it to me please?

CSS code piece:
Code:
.navdes{
background-color: #D4D4D4;
float:left;
width: 140px;
height: 35px;
text-decoration: none;
text-align: center;
font-family: Arial Black;
font-size:12pt;
}
#2

[eluser]ojcarga[/eluser]
@antoniog, this is not a CSS forum. Please find one to post those kind of thing.

Try apply the style directly to the anchor. Is the .navdes the DIV class?
If yes,

Code:
.navdes a{
  text-decoration: none;
}
#3

[eluser]Stefan Hueg[/eluser]
The topic to mention here is "inheritance".

What you are trying to do is to give your DIV the text-decoration: none; instruction. Better would be something like this:

Code:
.navdes a {...}
a.some_class {...}
a {...}

As you don't specifically say that underlining should be removed from anchors, this setting is inherited of your browser.
#4

[eluser]antoniog[/eluser]
a.class not expose the style.
#5

[eluser]antoniog[/eluser]
[quote author="ojcarga" date="1335807376"]@antoniog, this is not a CSS forum. Please find one to post those kind of thing.

Try apply the style directly to the anchor. Is the .navdes the DIV class?
If yes,

Code:
.navdes a{
  text-decoration: none;
}
[/quote]

Yes, .navdes is a DIV class.
Sorry, for post.
Nothing posts about affect anchor() with CSS.
#6

[eluser]CroNiX[/eluser]
Code:
.navdes a{
  text-decoration: none !important;
}
#7

[eluser]rip_pit[/eluser]
Agree with all the anwsers given,
i simply write down the html part to use with the css:

HTML
Code:
<div class="navdes">
  &lt;?php echo anchor('#url','Text','title="A text"') ?&gt;
</div>

CSS
Code:
.navdes a{text-decoration: none !important; }

EDIT: Replaced the html link with anchor
#8

[eluser]gbd_dee[/eluser]
are there any alternative ways
#9

[eluser]Stefan Hueg[/eluser]
[quote author="gbd_dee" date="1335823670"]are there any alternative ways[/quote]

Why? Those are already the most efficient ways.
#10

[eluser]antoniog[/eluser]
[quote author="rip_pit" date="1335822219"]Agree with all the anwsers given,
i simply write down the html part to use with the css:

HTML
Code:
<div class="navdes">
  <a href="#">Text</a>
</div>

CSS
Code:
.navdes a{text-decoration: none !important; }
[/quote]

Forgot I am using anchor()!




Theme © iAndrew 2016 - Forum software by © MyBB