File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 1391
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: 60063
    
  65

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: 1391
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: 60063
    
  65

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
 
Similar Threads
Center a Container on the Page
Click event is not firing
Passing values to same page
Failing to validate using ditchnet tabs
Control Image Size