|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
Grails overrides my css styles when a layout is applied to my gspI have a page that renders correctly before applying a layout. However when I include the layout meta tag It changes my tabs and buttons to underlined text
I took out all references to other .css files out of the layout main.gsp and it still changes the appearance. I actually took out everything but the tag <g:layoutBody />. What is causing this behavior? (grails version 1.1.1) |
|
|
Re: Grails overrides my css styles when a layout is applied to my gspTry installing Firefox and the add-on Firebug. You can then right click where the problem is on the page and "Inspect Element". The style information down the right hand side should tell you where the styling is coming from (which css file, which class etc). Hope this helps, Cheers, Chris.
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gsp
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gspGoing to that example page, if you Inspect Element on one of those tabs, somewhere down the style/selectors list in firebug you will see:
.yui-nav a { border-style:solid; color:#000000; text-decoration:none; } The "text-decoration:none" is the thing that stops the underlining. I think underlining links is default for firefox's html (and other browsers generally). If you click on the style tab in firebug there's a "Show User agent CSS" - this shows the css that Firefox is setting as its defaults. The text-decoration:underline set for *|*:-moz-any-link should be subsequently overriden by the .yui-nav a selector. If you can't see the yui selectors in the list in the firebug style, then your page is not including the "tabview.css" properly. Hope this helps, Cheers, Chris.
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gsp
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gspMaybe try downloading the tabview.css file and placing it in your css directory and include it that way, to see if it makes a difference?
If you can see text-decoration:none somewhere in the styles list in firebug (after rightclicking the underlined tab and "Inspect Element"), and it isn't crossed out (i.e. overriden) then you shouldn't see underlines. If it is crossed out then something further up the list is overriding it. If you can't see text-decoration:none in the list of styles anywhere, then either the tabview.css is not being included (this should be easy to see since you will have .yui type class selectors in the styles list), or the ".yui-nav a" selector is not matching to your html for some reason. OR its something different... Apologies, I'm relatively new to css myself :) Cheers, Chris.
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gsp
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gspAh that is helpful, but can only see the not working pic (couldn't see the firebugOfTabsWorking). From this it looks like you need to set your page body class thus:
<body class="yui-skin-sam">... The bit in the css file that overrides the underline will only apply with selectors: .yui-skin-sam .yui-navset .yui-navset-top .yui-nav a Whereas with your html page the browser is just seeing: .yui-navset .yui-navset-top .yui-nav a An alternative is to apply a "undohtml.css" before your other css includes. This is generally good practice since it gives you a good baseline of style that renders fairly consistently across browsers. You can then override these default settings as you see fit with your own css file(s). See this as an example: http://snipplr.com/view/266/undohtmlcss--tanteks-original-removes-browser-default-style/ Or search for: http://www.google.co.uk/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial&hs=ZRM&q=yui+reset+css&btnG=Search&meta=&aq=f&oq= Most of these undohtml stylesheets remove the underlines for links, which I think is what you want. If you still want underlines on links as default but just not on the tabs, you will have to edit the tabview.css file yourself. Hope this helps, Cheers, Chris.
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gsp
|
|
|
Re: Grails overrides my css styles when a layout is applied to my gspOk, try applying the <body class="yui-skin-sam"> to your views/layouts/main.gsp instead of your actual page. The sitemesh layout stuff will override the body tag in your page... Cheers, Chris. |
|
|
Re: Grails overrides my css styles when a layout is applied to my gsp
Ok, try applying the <body class="yui-skin-sam"> to your views/layouts/main.gsp instead of your actual page. The sitemesh layout stuff will override the body tag in your page... |
| Free embeddable forum powered by Nabble | Forum Help |