View Full Version : Links
TimFA
05-07-2007, 05:51 PM
Ok, I'm confident these 2 questions should be easy, but I'm not sure...
#1) Ok, I have a stylesheet for my site it looks like this:
<style>
body
{ background-color:
#E2E2E2
}
A:link
{ text-decoration: underline; color: blue; }
A:visited
{ text-decoration: Strike-through !!(tried strike through, strikethrough, strike-through)!! ; color: blue; }
A:hover
{ text-decoration: none; color: black; )
</style>
I cannot get the strikethrough attribute to work for me. Any suggestions?
NOTE: The note I put in, is not in my actual code.
#2) I want the stylesheet to be external but I'm not sure how to make the browser read it. I thikn it should be something like:
<style>
"text/css" src="some stuff.css"
</style>
But its just a guess.
mwinter
05-07-2007, 06:01 PM
I cannot get the strikethrough attribute to work for me. Any suggestions?
The value is line-through. Using a reference, such as the CSS specification (http://www.w3.org/TR/CSS21), is a good idea.
I want the stylesheet to be external but I'm not sure how to make the browser read it.
Use a link element:
<link rel="stylesheet" href="..." type="text/css">
The HTML specification (http://www.w3.org/TR/html4/) is also useful here as it describes how to reference external style sheets (http://www.w3.org/TR/html4/present/styles.html#h-14.3.2).
Mike
TimFA
05-07-2007, 06:02 PM
Thanks. I'm still learning, so I make plenty of mistakes...
TimFA
05-07-2007, 11:50 PM
Ok, now I need more help! Still CSS related! Ok, my page needs work still. I was using the FONT attributes all the way through but decided to leave it to CSS. when I followed the instructions it wouldn't function. My page was all messed up. If someone could please do this for me, I want the font on the page to be Arial, and the size to be 2 (I think thats right). Just in case I attached the current CSS code.
body
{ background-color:
#E2E2E2
}
A:link
{ text-decoration: underline; color: blue; }
A:visited
{ text-decoration: underline; color: blue; }
A:hover
{ text-decoration: none; color: black; )
NOTE: I attached a screeny of the site, its still on my computer (haven't updated web version yet) but I think its coming along. Also the reason for the bad quality is because of the upload size limit. If you're interested in a full quality let me know and I'll upload it to a different site.
Thanks, Tim
Veronica
05-08-2007, 03:03 AM
The old arial font size=2 is close to 10pt, so try this:
body {font-family:arial; font-size:10pt;}
TimFA
05-08-2007, 03:55 AM
Thank you so much. Exactly what was needed.
Nvm, its not. Its the default size, if I change it to say 8 or 7, no change... Help? Heres the code:
body
{ background-color:
#E2E2E2
}
body
{font-family:arial; font-size:10pt;}
A:link
{ text-decoration: underline; color: blue; }
A:visited
{ text-decoration: underline; color: blue; }
A:hover
{ text-decoration: none; color: black; )
Veronica
05-08-2007, 04:32 AM
If you still have font tags left in your code, in some browsers, the font tags will override the css. So do a search in your code for font, and make sure you've eliminated all the font tags. Then the css should take effect.
TimFA
05-08-2007, 04:33 AM
I'm using it on a new document with some gibberish text.
I also messed with the code a bit to see if I could make it work, heres the current. No effect on the page.
body
{ background-color:
#E2E2E2
}
body
{ font-family: Arial; font-size: 8pt; }
A:link
{ text-decoration: underline; color: blue; }
A:visited
{ text-decoration: underline; color: blue; }
A:hover
{ text-decoration: none; color: black; }
Figured it out. It just doesn't effect tables! My layout is purely tables. Arrgghhh!
jscheuer1
05-08-2007, 07:04 AM
That's no problem (you could just select tables in the style), though there probably is something causing the font size for the body being overridden in those tables. Percentage font sizes are better, but that is not the problem. Make sure that you have at least a transitional DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
font-family:arial, sans-serif;
font-size:85%;
}
</style>
</head>
<body>
<table>
<tr>
<td>HI</td>
</tr>
</table>
</body>
</html>
TimFA
05-08-2007, 07:14 AM
I copied the stylesheet part and it is. I also checked for thing in the tables, none. The actual font effects the table, just not sizes on them. Am I missing something here?
Heres the page I'm trying to put it in.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="layout_beta.css" type="text/css">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title></title>
</head>
<body>
Bill/Jill, is dead!
<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td>bbbb</td>
</tr>
</tbody>
</table>
<br>
</body>
</html>
And then heres the external stylesheet.
body {
background-color : #e2e2e2;
}
body {
font-family:arial, sans-serif;
font-size:85%;
}
A:link {
text-decoration : underline;
color : blue;
}
A:visited {
text-decoration : underline;
color : blue;
}
A:hover {
text-decoration : none;
color : black;
}
jscheuer1
05-08-2007, 07:20 AM
Try (copy) the whole thing to a new page, and yes, you must be missing something. You cannot, as Veronica said, have other font tags that could throw this off. As I said, use at least a transitional DOCTYPE. As I implied, if there are other styles on the page that could throw it off, they will.
TimFA
05-08-2007, 07:22 AM
I gave you the entire page its on. Not a single font tag that I see. I'm using a brand new page.
tech_support
05-08-2007, 07:31 AM
Try this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link rel="stylesheet" href="layout_beta.css" type="text/css">
</head>
<body>
<p>Bill/Jill, is dead!</p>
<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td><p>bbbb</p></td>
</tr>
</tbody>
</table>
</body>
</html>
CSS:
body {
background-color : #e2e2e2;
}
p {
font-family:arial, sans-serif;
font-size:85%;
}
a:link {
text-decoration : underline;
color : blue;
}
a:visited {
text-decoration : underline;
color : blue;
}
a:hover {
text-decoration : none;
color : black;
}
jscheuer1
05-08-2007, 07:34 AM
I gave you the entire page its on. Not a single font tag that I see. I'm using a brand new page.
Perhaps, but that is not the point. I gave you an entire page, use it.
TimFA
05-08-2007, 07:34 AM
Yeah! It applied, what was the issue?
tech_support
05-08-2007, 08:37 AM
I'm suspecting you put the stylesheet before the meta tags.
<link rel="stylesheet" href="layout_beta.css" type="text/css">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title></title>
And... I changed
body {
font....
}
to
p {
font....
}
jscheuer1
05-08-2007, 02:34 PM
Yeah! It applied, what was the issue?
And, if you were referring to my post, the DOCTYPE (yours didn't reference the posted standard) influences how styles are applied. Having the style in the wrong spot (if that's what you had) could also be a factor.
mwinter
05-08-2007, 03:30 PM
I'm suspecting you put the stylesheet before the meta tags.
<link rel="stylesheet" href="layout_beta.css" type="text/css">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
That doesn't matter, though a meta element that affects the encoding scheme should occur as early as possible (read: the first child element of the head element).
And, if you were referring to my post, the DOCTYPE (yours didn't reference the posted standard) influences how styles are applied.
More accurately, the rendering mode (Standard vs. Quirks) affects the default style sheet. Browsers operating in Quirks mode tend to add extra rules to the default style sheet for tables to produce a particular legacy effect. These would have to be explicitly overruled in an author style sheet.
Mike
TimFA
05-08-2007, 06:03 PM
Hahaha. I built a new page tried to apply the stylesheet it wouldn't size it still. So I put
<p>
tags and it worked.
jscheuer1
05-08-2007, 06:16 PM
Whatever works for you at this point, may just have to do.
boogyman
05-08-2007, 06:28 PM
Did you ever explicitly set it in the first place with a value rather then a percentage?
body {
font-size: small;
}
p {
font-size: 85%;
}
table {
font-size: 85%;
}
the only problem you will have with that is the issue of inheritance.
<body>
<p>Some Text</p>
<table>Some Table</table>
</body>
and
<body>
<p>Some Text
<table>Some Table</table>
</p>
</body>
should not render the same size.
The First should render
Body : small
P: 85% of small
Table: 85% of small
The Second should render
Body : small
P: 85% of small
Table: 85% of 85% of small
(eg if small is 12pt - p would be 85% of 12 = 10.2 -- 85% = 8.67 would be table)
That is the trouble with inheritance and using percentages; at the same time, when you wish to update the text size, you only need to update the initial value and the rest take their values from it... eg... 2seconds instead of minutes/hours trying to reconfigure the correct proportions
TimFA
05-08-2007, 07:25 PM
Ok, guys I've given up and just added a table attribute specifying a table with 80% font size and Arial. After I do that the p attribute becomes unused and if I change it to a body tag it goes just fine on the body, but the table gets ridiculously small. even if I change settings its at default and tables are at like 30%. So the bodys just gonna be Times News Romans and the tables can be Arial. Also, I'm using a new page no
<p> heres the currents CSS.
body {
background-color: #e2e2e2;
}
table {
font-family: Arial;
font-size: 80%;
}
a:link {
text-decoration: underline;
color: blue;
}
a:visited {
text-decoration: underline;
color: blue;
}
a:hover {
text-decoration: none;
color: black;
}
tech_support
05-09-2007, 06:09 AM
No, don't do that.
It's bad practice to put text without the <p></p> tags.
Let's see your code again and hopefully we can clean it up.
TimFA
05-10-2007, 07:39 AM
Hhmmm ... Fine, here:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link type="text/css" href="layout_beta.css"
rel="stylesheet">
<link href="images/favicon.ico" rel="shortcut icon">
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
<title>FreewareAssist | Home Beta Edition 1</title>
</head>
<body>
<table
style="background-image: url(images/header_beta.gif); width: 80%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="height: 81px; width: 165px;"><img
style="width: 165px; height: 75px;" alt="FreewareAssist"
title="FreewareAssist" src="images/logo_beta.gif"></td>
<td><br>
<br>
<br>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center;"></div>
<table
style="background-color: rgb(255, 255, 255); width: 80%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 60px;"><a
href="http://www3.webng.com/freewareassist/">Home<br>
</a> <br>
<a href="services/main.html">Services</a><br>
<br>
<a href="programs/main.html">Programs</a><br>
<br>
<a href="news/main.html">News</a><br>
<br>
<a href="help/main.html">Help</a><br>
<br>
<a href="contact/main.html">Contact</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
<td><img style="width: 2px; height: 620px;" alt=""
src="images/grey_back.gif"></td>
<td>Welcome to FreewareAssist Beta Edition 1!<br>
<br>
If you've had a freeware program before then you know that sometimes
their sites can die off. Or the authors can become un-responsive
(*cough* FDM *cough*), or they can be temporarily down. This site is
meant for those and other situations to help you out of those problems.
We'll try our best, if we can't then we can suggest another program for
you.<br>
<br>
If you'd like to be a moderator for the forums then contact <a
href="beamod.freewareassist@gmail.com">beamod.freewareassist@gmail.com.</a><br>
<br>
If you contact us please go to the <a href="help/neededinfo.html">Needed
Info</a> page.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center;"></div>
<table
style="width: 80%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="text-align: right;"><a
href="helpus/main.html">How can I help?</a></td>
</tr>
</tbody>
</table>
<div style="text-align: center;"></div>
<table
style="width: 80%; text-align: left; margin-left: auto; margin-right: auto;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="text-align: center;">Site last updated:
05-08-2007<br>
Updated by: Admin</td>
</tr>
</tbody>
</table>
</body>
</html>
Note that I haven't even tried to clean it up myself yet...
codeexploiter
05-10-2007, 08:14 AM
A:visited
{ text-decoration:Strike-through; color: blue; }
Can use the following to get a strike through effect
a:visited
{
color:blue;
text-decoration:line-through;
}
TimFA
05-10-2007, 04:15 PM
Yes I know that now. It doesn't look very good anyways, I guess a bad font size to try it with...
tech_support
05-10-2007, 10:37 PM
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Ouch. Never use <br> for padding, use <div style="padding-bottom:100px;"></div>
I'll have a look at it when I get home from school :)
TimFA
05-11-2007, 08:29 PM
Ok, I'm guessing there is a command in CSS fro centering everything on the page like HTML does? You know when you use
<center> </center> how it centers say the table its self but not the content inside the table?
chandran.am
05-12-2007, 11:37 AM
1st question's answer
<style>
body
{ background-color:
#E2E2E2
}
A:link
{ text-decoration: underline; color: blue; }
A:visited
{ text-decoration: line-through !!(try using line-through instead strike-through)!! ; color: blue; }
A:hover
{ text-decoration: none; color: black; )
</style>
2nd question's answer:
<link rel="stylesheet" href="somestuff.css" type="text/css" />
mwinter
05-12-2007, 01:29 PM
chandran.am: You're new and you're trying to help, which are good things. However, in future please read a thread before posting. The second post - mine - answered both original questions five days ago.
<link rel="stylesheet" href="somestuff.css" type="text/css" />
Whilst not a forum rule (read: you don't have to comply), I would ask for the benefit of others that you refrain from posting examples that include syntax derived from XHTML. If a poster is using XHTML, they should be more than capable of converting any HTML example to the XHTML equivalent. If they aren't, then they shouldn't be using XHTML in the first place.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.