Web Layout
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsWeb DesignWeb Layout

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 14th, 2005, 11:51 AM
pbd22 pbd22 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 71 pbd22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 14 m 22 sec
Reputation Power: 0
Question altering A:link, etc...

hi. i am using the a:link, a: hover, etc. convention in my style sheet. I call the code using:

Code:
Writer.RenderBeginTag(HtmlTextWriterTag.A)


i have another area of my page where i want to use the behaviours of a:etc but i want to change some of the layout stuff such as font and color. so, i created another area called
b:link, b:hover, and so on. in these areas of my page, i call:

Code:
Writer.RenderBeginTag(HtmlTextWriterTag.B)


my problem is that, no matter what i seem to do, "B" doesn't seem to do anything. It goes to the web pages master layout and doesn't link, hover, or anything. i have tried commenting out all of the other CSS references except "B" and it still doesn't matter... Are "link, hover, active, etc" only reserved for "A"? That seems silly to me. What am i doing wrong? Help much appreciated at this point...

Reply With Quote
  #2  
Old July 14th, 2005, 03:07 PM
Nebula Nebula is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 14 Nebula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 24 m
Reputation Power: 0
Throw this in the style sheet

.linkfont
{
color: green;
font-family: verdana , sans-serif;
font-size:11px;
}

a.linkfont:hover
{
color: #808080;
text-decoration: underline;
}

.linkfont2
{color: blue;
font-weight: bold;
font-family: verdana , sans-serif;
font-size:11px;
}

a.linkfont2:hover
{
color: #FF0000;
text-decoration: underline;
}

and use this for your links
<a href="somepage.asp" class="linkfont">Link 1</a>
<a href="somepage2.asp" class="linkfont2">Link 2</a>

Hope this helps

Reply With Quote
  #3  
Old July 15th, 2005, 05:47 PM
pbd22 pbd22 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 71 pbd22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 14 m 22 sec
Reputation Power: 0
Question

Hi. Thanks for your reply. That is more or less what i am doing except i am generating my code programatically so the code:

Code:
<a href="somepage.asp" class="linkfont">Link 1</a>
<a href="somepage2.asp" class="linkfont2">Link 2</a>


actually looks like this:

Code:

Writer.RenderBeginTag(HtmlTextWriterTag.Td)
Writer.AddAttribute(HtmlTextWriterAttribute.Href, "mypage.aspx")
Writer.RenderBeginTag(HtmlTextWriterTag.A)
Writer.WriteLine("this is my link text")
Writer.RenderEndTag()
Writer.RenderEndTag()


In my style sheet, i have "A:link, A:active, A:hover, etc" which all describe the look and format of "certain links" on mypage.aspx. then, for other links on the same page, "mypage.aspx", i have included "B:link, B:active, B:hover, etc" to acheive a different formatting look and feel. The problem is that B:etc does absolutely nothing despite my best efforts. For clarification, I have posted this area of my style sheet below"

Code:

A:link
{    
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
	BACKGROUND: none;
    color: #3333cc;
}

A:visited
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
BACKGROUND: none;
    color: #333399;
}

A:active
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
BACKGROUND: none;
    color: #333399;
}

A:hover
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: underline;
BACKGROUND: none;
    color: #FF0000;
}

B:link
{    
     /*font-family: Verdana, Arial, Helvetica, sans-serif;*/
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
	BACKGROUND: none;
    color: #3399CC;
    
}

B:visited
{
    
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
BACKGROUND: none;
    color: #333399;
}

B:active
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: bold;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
BACKGROUND: none;
    color: #FFFFFF;
}

B:hover
{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 1em;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: underline;
BACKGROUND: none;
    color: #FF0000;
}


I reference the "B" code the same way i referenced the working "A" code:

Code:

Writer.RenderBeginTag(HtmlTextWriterTag.Td)
Writer.AddAttribute(HtmlTextWriterAttribute.Href, "mypage.aspx")
Writer.RenderBeginTag(HtmlTextWriterTag.B)
Writer.WriteLine("this is my link text")
Writer.RenderEndTag()
Writer.RenderEndTag()


Can anybody tell me why the "A:hover, A:link, etc" code works while the "B:hover, B:link, etc" code has no effect? This one has me stumped...

Reply With Quote
  #4  
Old July 15th, 2005, 07:08 PM
Phoenix's Avatar
Phoenix Phoenix is offline
Web-Standards Evangelist
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Posts: 1,522 Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 48 m 4 sec
Reputation Power: 8
There is no "b" element in XHTML. Only the <a> element which is short for "<a>nchor".

Please learn the intracies of XHTML and SGML before dwelving into server-side programming

If you want to specify a different "style" of anchor elements, just give them a different classname (note: NOT to be confused with an OOP class) and then style it from CSS.

And question:

Why is your CSS full of useless properties? And why do you have "text-decoration: none;" several times for the same style rule?

Oh, and I'm an ASP.NET dev too... and I never use the HtmlWriter.... mainly because its too reliant on the BrowserCaps table (thus, you get convulted output when you're not using IE... plus it is rather slow). What's wrong with appending the elements manually using a StringBuilder?

Reply With Quote
  #5  
Old July 24th, 2005, 08:31 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,638 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1Folding Points: 374417 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 3 h 2 m 52 sec
Reputation Power: 1902
the <b> tag is valid in old html afaik, but it's not link it's used to make bold text.
and hover effect for any element is not supported by IE (only for <a> tag), that's probably why "it's not working" for you in case you're using IE to test your pages...

Reply With Quote
Reply

Viewing: ASP Free ForumsWeb DesignWeb Layout > altering A:link, etc...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT