How to include block of CSS code to insert inside { ... } of id#{ }? (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


avi_m -> How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 8:19:30)



While on the subject of includes,

anybody know if there a way of doing an include of a block of CSS code.

I have this in the header area of a DWT:

#masthead a { /* Keep button for current page "pressed"*/
color: #FFDDEB;
text-decoration: none;
/* 3-D - Non-pushed ... */
background-color: #FF468B;
position: relative;
top: 1px;
left: 1px;
border-color: #000 #aaa #aaa #000;
}

Don't ask why - it just has to be there.

Now how can I take just that block of CSS (inside the { } ) and make it external and just have a macro type thing that would represent it.

In the C language I could somewhere define a macro something like this:

define Pressed \
color: #FFDDEB;\
text-decoration: none;\
/* 3-D - Non-pushed ... */\
background-color: #FF468B;\
position: relative;\
top: 1px;\
left: 1px;\

I mean that I need that the following has to remain in the DWT:

#masthead a { /* Keep button for current page "pressed"*/
Pressed
}

and the definition for Pressed is outside, in an external style sheet or something
.

Can this be done? I need to use the CSS code for Pressed in other places, but apparently the definition for #masthead a has to be here in the DWT.

Thanks,

avi




jaybee -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 8:27:49)

So what you're basically doing is changing a hover state?




avi_m -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 10:45:33)

yup, you got very "warm", jaybee.

In fact, I am trying to implement a pure CSS method of keeping "alight" the navigation button coresponding to the current (sub)page on a site and making it work with DWTs. I have the #masthead thing inside an editable region in the header area, andfor each diff page attached to the DWT I simply change is to #about_the_site or #contact_us or whatever, and then the usual id thing in the <li> items in the vertical nav bar I have.

The thing is, is this chunk of CSS code,

color: #FFDDEB;
text-decoration: none;
/* 3-D - Non-pushed ... */
background-color: #FF468B;
position: relative;
top: 1px;
left: 1px;
border-color: #000 #aaa #aaa #000;


is going to be used elsewhere so I wanted to keep it in one global location and here have a reference to it instead of the CSS code itself.

At one other forum, it really threw all the experts, and it seems it cant be done, ie to express an ID selector in terms of a class.

Hang on, can' I do something like:

#masthead a class = "Pressed"

?

tia

- avi







jaybee -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 11:32:05)

quote:

#masthead a class = "Pressed"
No.

Take a look at http://www.cycling-services.co.uk/

You'll see the Home button is highlighted. Then click Contact you'll see that one is then highlighted. Go down the bottom, click Privacy Policy, same thing.

Is that what you're trying to do? If so, take a look at the code and css for the site and you'll see how it's done. If I'm way off beam here then perhaps an example would help.




Reflect -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 12:35:44)

JB,

What is the following META for?

<meta name="verify-v1" content="eZ+rRDDzcAtcId4MvH2gJem9NKaBMOltWcb/DEoav8Q=" />

Also, if I understand the coding right, on the highlight the key is "body id=" for the highlight? If so that is slick, nice solution.

Take care,

Brian




avi_m -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 15:55:58)

Yup, jaybee, that's exactly what I want to do - just like in the cycling site.

The problem is...

...that that method does not work with EW DWTs.

And why does it not work with EW DWTs...

coz that critical piece of code:

<body id="access">

is going to get reinited (=reinitialized) when the DWT does an update.

So, you say, put it inside an editable region. Good idea, it's just that EW ignores an editable region surrounding the <body> tag

.... would you believe.

Now would we call that a "design decision"? Forgetfullness on behalf of MS? Or just a plain bug?

tnx

- avi





Tailslide -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 16:50:27)

We've been here before haven't we Avi? Bet you're ready to throw the computer out the window! [:D]




jaybee -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 17:17:39)

quote:

What is the following META for?
Google verification.

quote:

Also, if I understand the coding right, on the highlight the key is "body id=" for the highlight?
Correct




jaybee -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/17/2007 17:19:35)

quote:

The problem is...

...that that method does not work with EW DWTs.

And why does it not work with EW DWTs...

coz that critical piece of code:

<body id="access">

is going to get reinited (=reinitialized) when the DWT does an update.


Bums!

How about killing the DWTs? [:D]




avi_m -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/22/2007 3:41:43)

Hi Jaybee,

>> Bums!

>> How about killing the DWTs? [:D]


But DWTs are so goood ....!


This sort of bug is what seems to make so many people want to throttle MS and its most famous person: MS gives great stuff and then smashes it up in some basic way, e.g., like Word's inability to do reliable auto numbered and auto bulleted lists.

avi









avi_m -> RE: How to include block of CSS code to insert inside { ... } of id#{ }? (5/22/2007 3:47:07)

Hi Tailslide,

>> We've been here before haven't we Avi? Bet you're ready to throw the computer out the window!

Yep, I sure have been here before. I had originally thought that there would be a pot of gold at the end of the rainbow., i.e., I just have to ask enough experts in enough forums to find out how to make my CSS current page indicator and I would learn something really fundamental and great about CSS / EW that would make the whole long journey worth the while.

Now, at the end of the road, it has turned out to be one of those famous MS bugs that make you want to throttle Uncle Bill (see my other recent post on this thread).

How do you file a bug report to MS about EW?

tia

avi





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125