aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes CSS Selector for Embeded DIV Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "CSS Selector for Embeded DIV" Watch "CSS Selector for Embeded DIV" New topic
Author

CSS Selector for Embeded DIV

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1490
    
    1
What syntax would I use to select the msgDisp div tag?

I have tried:

.msgDisp
.logonheaderdiv .msgDisp
.header1.loginheaderdiv .msgDisp
.logonheaderdiv>.msgDisp

I want to set the background-color to red but have it use the other attributes set by the .header1.loginheaderdiv div selector.


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

Steve Dyke wrote:What syntax would I use to select the msgDisp div tag?

I have tried:

.msgDisp

That will work just fine to select the element.

I want to set the background-color to red but have it use the other attributes set by the .header1.loginheaderdiv div selector.

How you select has nothing to do with what will be applied. Inheritable attributes will be passed down to descendants regardless of how you write the selector.

And what do you have against real words like message-display?

And what is this about:

onclick="javascript:showabout();return false;"

The javascript: pseudo-protocol is superfluous and, well, just flat out wrong. Remove it.

(I'd also argue that you should not be embedding behavior in the markup -- see Unobtrusive JavaScript -- but that's another show.)



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1490
    
    1
Bear Bibeault wrote:

(I'd also argue that you should not be embedding behavior in the markup -- see Unobtrusive JavaScript -- but that's another show.)




How would I use this stategy in this case?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

I don't know what you mean by "this strategy".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CSS Selector for Embeded DIV