Hi, A small mistake, I don't want to specify the width for #navbar and I want it to inherit the width from the #header (ie. width:100%). #navbar comes inside #header. navbar's css rules are in nav_bar.css and header's css rules are in cake.generic.css. So, how do i link these 2 css files so that navbar inherits the width of header?
if I put the following in nav_bar.css, it doesn't seem to work. @import "cake.generic.css"; #header #navbar { margin: 0; padding: 0; height: 1em; } thank you. On Apr 20, 2:57 am, cricket <zijn.digi...@gmail.com> wrote: > On Tue, Apr 19, 2011 at 11:33 AM, varai <vaanip...@gmail.com> wrote: > > Hi, > > > I have > > #navbar { > > margin: 0; > > padding: 0; > > height: 1em; > > width:100%; } > > in nav_bar.css > > > #navbar div comes under #header div from cake.generic.css, so #navbar > > div should inherit the properties of #header div. > > #header{ > > width:100%; > > } > > > So, how do Ilinknav_bar.cssand cake.generic.cssso that #navbar > > inherits all the properties of #header? > > Are you asking how to load theCSSfile? > echo $this->Html->css('nav_bar', 'stylesheet', array('media'=>'screen, > projection')); > > Or are you asking a purelyCSSquestion? When you say that #navbar > comes "under" #header, do you mean that it comes after it in the > source, or is *inside* #header? Because the styles only cascade for > elements inside one another, not just if the one block comes after > another. > > Keep in mind, though, that not all rules are inherited for block > elements (where one is inside the other). Things like width, margin, > padding, etc. > > But it seems a moot point as both elements have explicit width: 100% > rules, anyway.- Hide quoted text - > > - Show quoted text - -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php