HTML question

Started by Igor, Sat 22/11/2003 17:30:17

Previous topic - Next topic

Igor

I'm just working on my web site and i stumbled into a problem- at the moment, no matter what i try, html always add a line under text links...
So i was wondering if there's a way to make text links without that blasted under-line?

Thanks in advance!

Pau

Maybe this is what you are looking for, here you have a sample:

<BODY>
<P><SPAN STYLE="text-decoration: none">link-to-my-page</SPAN></P>
</BODY>

paused -- get the startup menu creator (version 1.1) for AGS games. (Use save target as..)

Darth Mandarb

Pau got it with his too.  But there's another way.  You define a style, in the <head></head> tag area, for links like this:


<style type="text/css">
<!--
.links
 {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   font-size: 10px;
   color: 000000;
   text-decoration: none;
}
-->
</style>


You can call the .links whatever you want so you'll remember it.

Then, in your links, you do this:

<a href="yourlink.html" class="links">Your Link Here</a>

Using this you can also create mouseOver effects by doing this (you'd need to create the mouseOver style as well (just change the color or something))

<a href="yourlink.html" class="links" onMouseOver="this.className='linksOVER'" onMouseOut="this.className='links'">You Link Here</a>


Hope this helped!

Have fun!!

]).]v[.

Evil

#3
BWAHAHAHAHA! My geocities account has teh option to do somethign such as this! HARARA! LOOK At My R)x0r W3bpaGe!!!1!&(69651

www.takeoff.to/harryspage

editL: sorry for the pimping...

Igor

Ah, thanks a bunch Pau and DM! :)

Btw, cool site Evil- i like crazy fonts!

Ishmael

Sorry for diggin' this ol' thead up, but I playing around with these things, and they work great, except for one thing: when the page (upper frame, I have frameset for 'rows') is loaded, the links are on the color set in <body bgcolor = .... link = ...>, underlined and so on, and when I put the mouse over them, they are set correct, font to Arial and underlining off, and on when mouse is over...

Is there a way to get around this? Well, of cource there is, but where?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

TerranRich

This is the correct way to do it:

In the <HEAD>...</HEAD> area of the web page, add this:

<STYLE TYPE="text/css">
<!--
A {
text-decoration:none;
}

A:hover {
text-decoration:none;
}
-->
</STYLE>


The <!--  ...  --> tags are there to keep the code commented in case your browser doesn't support it and decides to blurt out your code...although most browsers should, by right, support everything by now.

Using this, you could also define the colors (even a background color for hovering links) and font weight links. And you only have to use the regular <A...></A> tags the normal way.

This is called Cascading Style Sheets (CSS) and you can visit http://www.w3.org/Style/CSS for more information on it. :)
Status: Trying to come up with some ideas...

Miez

CSS takes some getting used to, but once you've discovered it you'll never want to go back to the old '<font face="Arial....' tags etc.
And if you have a somewhat larger website, you can also put all your CSS definitions in a textfile, call it "anything.css", smack it on your server and link to it in all your pages. That makes changing the whole appearance of your website soooo easy.
A link to an external CSS file goes in the <HEAD> ... </HEAD> bit of your page and looks like this:

<LINK REL="StyleSheet" HREF="anything.css" TYPE="text/css">

Darth Mandarb

terran - That is the easiest way to do it.  The reason I don't do it that way is because I always have (well usually) two or more link types in my websites.  Like, 1 type that is underlined, and one that is not.

If you redefine that <a></a> tag like that, all links in the page will follow that definition and if you want a certain link to be underlined you can't have it.

Miez is right ... once you start using CSS you'll begin to wonder how you ever got on without it!  I equate it to photoshop and layers.  When layers were first introduced I hated them ... now I wonder how I ever thought that!

])]v[

Ishmael

#9
Thank you, wonderful people! This is exactly what I needed. :)

* TK bows and quickly fixes a typo
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk