DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   Changing the appearance of A HREF (http://www.daniweb.com/forums/thread120024.html)

OmniX Apr 20th, 2008 1:50 am
Changing the appearance of A HREF
 
I am trying to set the the attributes (border, width, etc) of a href tag using CSS.

But it is being very annoying!

Padding is working and color and thats just about it.

Width, height, borders (only see 2/3 out of the 4 sidded box), etc.

Any ideas?

Thanks, Regards X

PS: Note when I use the style on other tags there are different outcomes.

lio04 Apr 20th, 2008 2:01 pm
Re: Changing the appearance of A HREF
 
A href tag is only link, you can't set border, height, width.

These attributes you can set to any <div id="">, <img> tags and other, which be bounded between <a href="#"></a>.

Show here your code, because we don't know, what you need create with code.

OmniX Apr 21st, 2008 2:40 am
Re: Changing the appearance of A HREF
 
pretty much just using css to make a href a box.

style="border: 3px solid; etc";

so you saying if i encapsulate it inside a div tag it will work?

lio04 Apr 21st, 2008 4:09 am
Re: Changing the appearance of A HREF
 
E.g. like this

In HTML file will be:
<a href="#"><div id="box">Active box</div></a>

In CSS file will be:
#box{
        width: 160px;
        height: 180px;
        background-color: black;
        border: 3px solid #A2A2F2;
        color: white;
        font-size: 36px;
}

This is only short example..

OmniX Apr 21st, 2008 4:47 am
Re: Changing the appearance of A HREF
 
sounds cool ill try it and get back to you, thankyou :)

MidiMagic Apr 22nd, 2008 3:46 am
Re: Changing the appearance of A HREF
 
That won't validate - it's tag soup.

The anchor tag is an inline tag, and you can't put a block tag pair inside an inline tag pair. Div is a block tag.

You can't put box properties on inline tags either.

Put the anchor inside the div instead, and attach the box properties to the div.

OmniX Apr 22nd, 2008 3:53 am
Re: Changing the appearance of A HREF
 
Thats what I thought so should be like:

<div>
 <a href>
  LINK
 </a>
</div>

Thats it?

Been to busy at work to test it.

Regards, X


All times are GMT -4. The time now is 9:41 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC