This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > March 2007 > Problems with Borders using CSS





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problems with Borders using CSS
simonbrentford@googlemail.com

2007-03-28, 7:18 am

Hello,

I am validating my webpages for HTML 4.01 Transitional. I have the
problem that I cannot remove a border on a small graphic on my page. I
have researched various websites for the correct CSS code but none
seems to work.

The HTML code:

<img class="YelArLL" alt="">

The CSS code:

..YelArLL {
BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');
BORDER-COLLAPSE: collapse;
height: 14px;
width: 16px;
margin: 0px;
padding 0px;
color: #000000;
border-style: none;
}


Take a look at the webpage to see what it looks like. (http://
www.skydiving.co.uk/tandem2.htm)
Its the small yellow arrow on the left side with a border. Notice the
other arrows are fine when done without CSS. Any ideas?

Cheers, Simon

Vince Morgan

2007-03-28, 7:18 pm


<simonbrentford@googlemail.com> wrote in message
news:1175078958.922169.325080@n59g2000hsh.googlegroups.com...
> Hello,
>
> I am validating my webpages for HTML 4.01 Transitional. I have the
> problem that I cannot remove a border on a small graphic on my page. I
> have researched various websites for the correct CSS code but none
> seems to work.
> The CSS code:
>
> .YelArLL {
> BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');
> BORDER-COLLAPSE: collapse;


I would replace the above line in your css -> border:none;

> Take a look at the webpage to see what it looks like. (http://
> www.skydiving.co.uk/tandem2.htm)
> Its the small yellow arrow on the left side with a border. Notice the
> other arrows are fine when done without CSS. Any ideas?
>
> Cheers, Simon
>

HTH
Vince Morgan


Vince Morgan

2007-03-28, 7:18 pm


<simonbrentford@googlemail.com> wrote in message
news:1175078958.922169.325080@n59g2000hsh.googlegroups.com...

>
> I would replace the above line in your css -> border:none;
>

Looking more closely at the image on the site, it could actualy be the
anchor border that is visible.
If that's the case then you will need to do the same for the anchor too.
Give it a class with the same border attribute.
[color=darkred]


Jukka K. Korpela

2007-03-28, 7:18 pm

Scripsit simonbrentford@googlemail.com:

> I am validating my webpages for HTML 4.01 Transitional.


That's a start, but you should also use correct CSS (and to aim at HTML 4.01
Strict if feasible). And you should actually produce valid markup, not just
"validate".

> I have the
> problem that I cannot remove a border on a small graphic on my page.


Well, on Firefox, there is no border - but no graphic either.

> I have researched various websites for the correct CSS code but none
> seems to work.


You haven't used the W3C CSS Validator. It would report the syntax errors,
which should be fixed before more complicated troubleshooting.
Alternatively, use Firefox and view the console log (error log) via the
Tools menu.

> BORDER-COLLAPSE: collapse;


That's formally correct but has no effect, since it only affects tables.

> padding 0px;


That's malformed (no colon).

> Take a look at the webpage to see what it looks like. (http://
> www.skydiving.co.uk/tandem2.htm)


It looks messy. So? The markup is messy, too, and so is the CSS code. Even
with tools like CSS checkers, you will have difficulties in maintaining the
page, due to its unnecessary complexity.

For example, if you want to use yellow arrows as item markers, why don't you
just use list markup and set list-style-image?

Followups trimmed to c.i.w.a.s.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

simonbrentford@googlemail.com

2007-03-28, 7:18 pm

Unfortunately that did not work. Hmm?

simonbrentford@googlemail.com

2007-03-28, 7:18 pm

Thanks Jukka,

I appreciate there is too much complexity on the page. I am precisely
using the W3C validator to check for errors and this is how I noticed
the error. I will keep looking for a solution to this.

Simon

Vince Morgan

2007-03-28, 7:18 pm


<simonbrentford@googlemail.com> wrote in message
news:1175078958.922169.325080@n59g2000hsh.googlegroups.com...
> Hello,
>
> I am validating my webpages for HTML 4.01 Transitional. I have the
> problem that I cannot remove a border on a small graphic on my page. I
> have researched various websites for the correct CSS code but none
> seems to work.


As Jukka previously mentioned your markup and your css need a good clean up.

Something very curious.
"<img class="YelArLL" alt=""><br>"
The class in question is being applied to the above tag, but I don't see any
image there.
The image tag below that has no class, but it's the one with the yellow
arrow image.

HTH
Vince Morgan



simonbrentford@googlemail.com

2007-03-28, 7:18 pm

Inside the CSS file you will find the image. I did another experiment
and created an almost blank page with just 2 examples with CSS and
without. The problem still exists.

This is the HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
<link href="styleTS.css" rel="stylesheet" type="text/css">

</head>

<body>
<img class="YelArLL" alt=""><br>Cannot remove border - using CSS<p>
<img border="0" src="Images/YellowArrowLowerLeftHeader.png" width="16"
height="14"><br>
Border - without CSS but not W3C compliant</p>
</body>

</html>

This is the CSS:

..YelArLL {
BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');
height: 14px;
width: 16px;
border: none;
margin: 0;
padding: 0;
}

Its still not working....
Simon

David Berry

2007-03-28, 7:18 pm

BACKGROUND-IMAGE is for the BODY Tag. You can't use it for the IMG tag.
See my other reply to you.

--
David Berry
FrontPage Support: http://www.frontpagemvps.com/



<simonbrentford@googlemail.com> wrote in message
news:1175089009.784276.172070@l77g2000hsb.googlegroups.com...
> Inside the CSS file you will find the image. I did another experiment
> and created an almost blank page with just 2 examples with CSS and
> without. The problem still exists.
>
> This is the HTML:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Language" content="en-gb">
> <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">
> <title>New Page 1</title>
> <link href="styleTS.css" rel="stylesheet" type="text/css">
>
> </head>
>
> <body>
> <img class="YelArLL" alt=""><br>Cannot remove border - using CSS<p>
> <img border="0" src="Images/YellowArrowLowerLeftHeader.png" width="16"
> height="14"><br>
> Border - without CSS but not W3C compliant</p>
> </body>
>
> </html>
>
> This is the CSS:
>
> .YelArLL {
> BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');
> height: 14px;
> width: 16px;
> border: none;
> margin: 0;
> padding: 0;
> }
>
> Its still not working....
> Simon
>


Vince Morgan

2007-03-28, 7:18 pm

<simonbrentford@googlemail.com> wrote in message
news:1175089009.784276.172070@l77g2000hsb.googlegroups.com...
> <body>
> <img class="YelArLL" alt=""><br>Cannot remove border - using CSS<p>
> <img border="0" src="Images/YellowArrowLowerLeftHeader.png" width="16"
> height="14"><br>
> Border - without CSS but not W3C compliant</p>
> </body>
>
> </html>
>
> This is the CSS:
>
> .YelArLL {
> BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');


Hmmm,, I feel somewhat silly right now.
That's a background image. Why didn't I notice that earlier :)
I don't think that is what you are after at all.

try replacing;
"<img class="YelArLL" alt=""><br>Cannot remove border - using CSS<p>"
with;
"<img class="YelArLL" alt="" src="Images/YellowArrowLowerLeftHeader.png"
then remove;
"BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');"
from the class.

I think I want it to work now more than you do :)


Andy Dingley

2007-03-28, 7:18 pm

On 28 Mar, 14:45, "David Berry" <dbe...@mvps.org> wrote:
> BACKGROUND-IMAGE is for the BODY Tag. You can't use it for the IMG tag.


Rubbish. The background-image property is applicable to all sorts of
element, and certainly for <img>

> --
> David Berry
> FrontPage Support: http://www.frontpagemvps.com/


That explains a lot. 8-(

Jukka K. Korpela

2007-03-28, 7:18 pm

Scripsit simonbrentford@googlemail.com:

> <link href="styleTS.css" rel="stylesheet" type="text/css">


Are we supposed to guess the base address?

Please post URLs, not fragments of code; quote or paraphrase what you are
commenting on; and select _the_ best group for you messages (I helped you
this time by setting followups).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

dorayme

2007-03-28, 7:19 pm

In article
<1175093367.783508.300370@n59g2000hsh.googlegroups.com>,
"Andy Dingley" <dingbat@codesmiths.com> wrote:

> On 28 Mar, 14:45, "David Berry" <dbe...@mvps.org> wrote:
>
> Rubbish. The background-image property is applicable to all sorts of
> element, and certainly for <img>
>
>
> That explains a lot. 8-(


I want to know if he appreciates how cutting a remark this is?
How can I find out?

--
dorayme
Neredbojias

2007-03-29, 4:18 am

On Wed, 28 Mar 2007 10:49:18 GMT scribed:

> Hello,
>
> I am validating my webpages for HTML 4.01 Transitional. I have the
> problem that I cannot remove a border on a small graphic on my page. I
> have researched various websites for the correct CSS code but none
> seems to work.
>
> The HTML code:
>
> <img class="YelArLL" alt="">
>
> The CSS code:
>
> .YelArLL {
> BACKGROUND-IMAGE: url('Images/YellowArrowLowerLeftHeader.png');
> BORDER-COLLAPSE: collapse;
> height: 14px;
> width: 16px;
> margin: 0px;
> padding 0px;
> color: #000000;
> border-style: none;
> }
>
>
> Take a look at the webpage to see what it looks like. (http://
> www.skydiving.co.uk/tandem2.htm)
> Its the small yellow arrow on the left side with a border. Notice the
> other arrows are fine when done without CSS. Any ideas?
>
> Cheers, Simon


Well, you first need an image to be able to remove the "border".
Where's your src?

--
Neredbojias
He who laughs last sounds like an idiot.
simonbrentford@googlemail.com

2007-03-29, 7:18 pm

I see. I will try to put the SRC command in. Yes maybe I should have
put the full URL in. I am falible unfortunately!

But thanks to all who have made suggestions. I will let you know how I
get on.

Simon

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews