Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strange css problem (bug?)

Reply
Thread Tools

Strange css problem (bug?)

 
 
M O J O
Guest
Posts: n/a
 
      08-28-2005
Hi,

I'm developing a asp.net application and ran into a strange css problem.

I want all my links to have a dashed underline and when they are
hovered, it must change to a solid line. Sounds simple, but it's not
working.

I've cooked down my output code to show you what I mean. If you run the
code below, there's no line under the link, but if you either remove the
<!DOCTYPE...> line or the body-part of the css decleration, everything
works fine.

Here's my code (watch for wrappings):

----------------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Strange</title>
<style>
<!--
body
{
font-family: verdana, arial, helvetica, sans-serif;
}


a:link, a:visited
{
font-family: verdana, arial, helvetica, sans-serif;
color: #d32525;
border-bottom: 1px dashed #d32525;
text-decoration: none;
}

a:hover
{
font-family: verdana, arial, helvetica, sans-serif;
color: #d32525;
border-bottom: 1px solid #d32525;
text-decoration: none;
}
-->
</style>
</head>

<body>
<a href="http://www.microsoft.com/">This is just a link</a>
</body>

</html>

----------------------------------------------------------------------

Any idea???????

I also found out, if I put a <p>&nbsp;</p> below the <a href...> in the
code above, everything works fine.

I'm confused!!!!!

HHHHEEELLLPPPPP! )

Thank you in advance.

M O J O
 
Reply With Quote
 
 
 
 
tom pester
Guest
Posts: n/a
 
      08-28-2005

Check out the css newsgroup

Let me know if you have any more questions...

Cheers,
Tom Pester

> Hi,
>
> I'm developing a asp.net application and ran into a strange css
> problem.
>
> I want all my links to have a dashed underline and when they are
> hovered, it must change to a solid line. Sounds simple, but it's not
> working.
>
> I've cooked down my output code to show you what I mean. If you run
> the code below, there's no line under the link, but if you either
> remove the <!DOCTYPE...> line or the body-part of the css decleration,
> everything works fine.
>
> Here's my code (watch for wrappings):
>
> ----------------------------------------------------------------------
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">
> <title>Strange</title>
> <style>
> <!--
> body
> {
> font-family: verdana, arial, helvetica, sans-serif;
> }
> a:link, a:visited
> {
> font-family: verdana, arial, helvetica, sans-serif;
> color: #d32525;
> border-bottom: 1px dashed #d32525;
> text-decoration: none;
> }
> a:hover
> {
> font-family: verdana, arial, helvetica, sans-serif;
> color: #d32525;
> border-bottom: 1px solid #d32525;
> text-decoration: none;
> }
> -->
> </style>
> </head>
> <body>
> <a href="http://www.microsoft.com/">This is just a link</a>
> </body>
> </html>
>
> ----------------------------------------------------------------------
>
> Any idea???????
>
> I also found out, if I put a <p>&nbsp;</p> below the <a href...> in
> the code above, everything works fine.
>
> I'm confused!!!!!
>
> HHHHEEELLLPPPPP! )
>
> Thank you in advance.
>
> M O J O
>



 
Reply With Quote
 
 
 
 
M O J O
Guest
Posts: n/a
 
      08-28-2005
Hi Tom,

Which group are you exactly talking about?

M O J O

tom pester wrote:
>
> Check out the css newsgroup
>
> Let me know if you have any more questions...
>
> Cheers,
> Tom Pester
>
>> Hi,
>>
>> I'm developing a asp.net application and ran into a strange css
>> problem.
>>
>> I want all my links to have a dashed underline and when they are
>> hovered, it must change to a solid line. Sounds simple, but it's not
>> working.
>>
>> I've cooked down my output code to show you what I mean. If you run
>> the code below, there's no line under the link, but if you either
>> remove the <!DOCTYPE...> line or the body-part of the css decleration,
>> everything works fine.
>>
>> Here's my code (watch for wrappings):
>>
>> ----------------------------------------------------------------------
>>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html;
>> charset=windows-1252">
>> <title>Strange</title>
>> <style>
>> <!--
>> body
>> {
>> font-family: verdana, arial, helvetica, sans-serif;
>> }
>> a:link, a:visited
>> {
>> font-family: verdana, arial, helvetica, sans-serif;
>> color: #d32525;
>> border-bottom: 1px dashed #d32525;
>> text-decoration: none;
>> }
>> a:hover
>> {
>> font-family: verdana, arial, helvetica, sans-serif;
>> color: #d32525;
>> border-bottom: 1px solid #d32525;
>> text-decoration: none;
>> }
>> -->
>> </style>
>> </head>
>> <body>
>> <a href="http://www.microsoft.com/">This is just a link</a>
>> </body>
>> </html>
>>
>> ----------------------------------------------------------------------
>>
>> Any idea???????
>>
>> I also found out, if I put a <p>&nbsp;</p> below the <a href...> in
>> the code above, everything works fine.
>>
>> I'm confused!!!!!
>>
>> HHHHEEELLLPPPPP! )
>>
>> Thank you in advance.
>>
>> M O J O
>>

>
>

 
Reply With Quote
 
tom pester
Guest
Posts: n/a
 
      08-28-2005
http://groups.google.com/group/comp....ts?gvc=2&hl=en

Let me know if it helped you or not...

Cheers,
Tom Pester

> Hi Tom,
>
> Which group are you exactly talking about?
>
> M O J O
>
> tom pester wrote:
>
>> Check out the css newsgroup
>>
>> Let me know if you have any more questions...
>>
>> Cheers,
>> Tom Pester
>>> Hi,
>>>
>>> I'm developing a asp.net application and ran into a strange css
>>> problem.
>>>
>>> I want all my links to have a dashed underline and when they are
>>> hovered, it must change to a solid line. Sounds simple, but it's not
>>> working.
>>>
>>> I've cooked down my output code to show you what I mean. If you run
>>> the code below, there's no line under the link, but if you either
>>> remove the <!DOCTYPE...> line or the body-part of the css
>>> decleration, everything works fine.
>>>
>>> Here's my code (watch for wrappings):
>>>
>>> --------------------------------------------------------------------
>>> --
>>>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>>
>>> <html>
>>> <head>
>>> <meta http-equiv="Content-Type" content="text/html;
>>> charset=windows-1252">
>>> <title>Strange</title>
>>> <style>
>>> <!--
>>> body
>>> {
>>> font-family: verdana, arial, helvetica, sans-serif;
>>> }
>>> a:link, a:visited
>>> {
>>> font-family: verdana, arial, helvetica, sans-serif;
>>> color: #d32525;
>>> border-bottom: 1px dashed #d32525;
>>> text-decoration: none;
>>> }
>>> a:hover
>>> {
>>> font-family: verdana, arial, helvetica, sans-serif;
>>> color: #d32525;
>>> border-bottom: 1px solid #d32525;
>>> text-decoration: none;
>>> }
>>> -->
>>> </style>
>>> </head>
>>> <body>
>>> <a href="http://www.microsoft.com/">This is just a link</a>
>>> </body>
>>> </html>
>>> --------------------------------------------------------------------
>>> --
>>>
>>> Any idea???????
>>>
>>> I also found out, if I put a <p>&nbsp;</p> below the <a href...> in
>>> the code above, everything works fine.
>>>
>>> I'm confused!!!!!
>>>
>>> HHHHEEELLLPPPPP! )
>>>
>>> Thank you in advance.
>>>
>>> M O J O
>>>



 
Reply With Quote
 
Stefan
Guest
Posts: n/a
 
      08-28-2005
Try putting your style-block before the body tag. Inside the head you
should only refer to external css files.

 
Reply With Quote
 
M O J O
Guest
Posts: n/a
 
      08-28-2005
Okay thanks, I'll give it a try.

M O J O

tom pester wrote:
> http://groups.google.com/group/comp....ts?gvc=2&hl=en
>
>
> Let me know if it helped you or not...
>
> Cheers,
> Tom Pester
>
>> Hi Tom,
>>
>> Which group are you exactly talking about?
>>
>> M O J O
>>
>> tom pester wrote:
>>
>>> Check out the css newsgroup
>>>
>>> Let me know if you have any more questions...
>>>
>>> Cheers,
>>> Tom Pester
>>>
>>>> Hi,
>>>>
>>>> I'm developing a asp.net application and ran into a strange css
>>>> problem.
>>>>
>>>> I want all my links to have a dashed underline and when they are
>>>> hovered, it must change to a solid line. Sounds simple, but it's not
>>>> working.
>>>>
>>>> I've cooked down my output code to show you what I mean. If you run
>>>> the code below, there's no line under the link, but if you either
>>>> remove the <!DOCTYPE...> line or the body-part of the css
>>>> decleration, everything works fine.
>>>>
>>>> Here's my code (watch for wrappings):
>>>>
>>>> --------------------------------------------------------------------
>>>> --
>>>>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>>>
>>>> <html>
>>>> <head>
>>>> <meta http-equiv="Content-Type" content="text/html;
>>>> charset=windows-1252">
>>>> <title>Strange</title>
>>>> <style>
>>>> <!--
>>>> body
>>>> {
>>>> font-family: verdana, arial, helvetica, sans-serif;
>>>> }
>>>> a:link, a:visited
>>>> {
>>>> font-family: verdana, arial, helvetica, sans-serif;
>>>> color: #d32525;
>>>> border-bottom: 1px dashed #d32525;
>>>> text-decoration: none;
>>>> }
>>>> a:hover
>>>> {
>>>> font-family: verdana, arial, helvetica, sans-serif;
>>>> color: #d32525;
>>>> border-bottom: 1px solid #d32525;
>>>> text-decoration: none;
>>>> }
>>>> -->
>>>> </style>
>>>> </head>
>>>> <body>
>>>> <a href="http://www.microsoft.com/">This is just a link</a>
>>>> </body>
>>>> </html>
>>>> --------------------------------------------------------------------
>>>> --
>>>>
>>>> Any idea???????
>>>>
>>>> I also found out, if I put a <p>&nbsp;</p> below the <a href...> in
>>>> the code above, everything works fine.
>>>>
>>>> I'm confused!!!!!
>>>>
>>>> HHHHEEELLLPPPPP! )
>>>>
>>>> Thank you in advance.
>>>>
>>>> M O J O
>>>>

>
>

 
Reply With Quote
 
M O J O
Guest
Posts: n/a
 
      08-28-2005
Hi Stefan,

Thanks for letting me know. Unfortunately it does not solve my problem.

(

Hmmmmm.

Thanks anyway.

M O J O

Stefan wrote:
> Try putting your style-block before the body tag. Inside the head you
> should only refer to external css files.
>

 
Reply With Quote
 
Bruce Barker
Guest
Posts: n/a
 
      08-29-2005
your problem is that an <a> is an inline element, not a block element, so it
does not have a border. normally you use the text-decoration to control
underlining, but there is no dashed version. you can try setting the display
style to block.

-- bruce (sqlwork.com)



"M O J O" <mojo@_no_spam_delete_this_newwebsolutions.dk> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm developing a asp.net application and ran into a strange css problem.
>
> I want all my links to have a dashed underline and when they are hovered,
> it must change to a solid line. Sounds simple, but it's not working.
>
> I've cooked down my output code to show you what I mean. If you run the
> code below, there's no line under the link, but if you either remove the
> <!DOCTYPE...> line or the body-part of the css decleration, everything
> works fine.
>
> Here's my code (watch for wrappings):
>
> ----------------------------------------------------------------------
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <title>Strange</title>
> <style>
> <!--
> body
> {
> font-family: verdana, arial, helvetica, sans-serif;
> }
>
>
> a:link, a:visited
> {
> font-family: verdana, arial, helvetica, sans-serif;
> color: #d32525;
> border-bottom: 1px dashed #d32525;
> text-decoration: none;
> }
>
> a:hover
> {
> font-family: verdana, arial, helvetica, sans-serif;
> color: #d32525;
> border-bottom: 1px solid #d32525;
> text-decoration: none;
> }
> -->
> </style>
> </head>
>
> <body>
> <a href="http://www.microsoft.com/">This is just a link</a>
> </body>
>
> </html>
>
> ----------------------------------------------------------------------
>
> Any idea???????
>
> I also found out, if I put a <p>&nbsp;</p> below the <a href...> in the
> code above, everything works fine.
>
> I'm confused!!!!!
>
> HHHHEEELLLPPPPP! )
>
> Thank you in advance.
>
> M O J O



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange problem with asp:Textbox and CSS filter:alpha sjickells@gmail.com ASP .Net 0 06-21-2007 02:44 PM
AVG Email Scanner activating at strange times with strange IP addresses dennispublic@hotmail.com Computer Support 1 08-26-2006 04:27 AM
Master page and CSS link strange problem. =?Utf-8?B?bmljaw==?= ASP .Net 3 06-22-2006 04:56 AM
Strange CSS problem Elmo Watson ASP .Net 4 11-03-2005 04:41 PM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments