toolman Posted November 15, 2013 Share Posted November 15, 2013 Hi there, I have the following HTML: <body> <div class="all">text</div> </body> Is it possible to give the body tag a style based on the <div> with a class of .all? I want to do this only with CSS. Thanks Link to comment https://forums.phpfreaks.com/topic/283927-select-body-tag-from-div-class/ Share on other sites More sharing options...
Ch0cu3r Posted November 15, 2013 Share Posted November 15, 2013 Maybe body, .all { /* styles applies to both <body> and class="all" */ } Link to comment https://forums.phpfreaks.com/topic/283927-select-body-tag-from-div-class/#findComment-1458411 Share on other sites More sharing options...
cyberRobot Posted November 15, 2013 Share Posted November 15, 2013 On 11/15/2013 at 4:39 PM, Ch0cu3r said: Maybe body, .all { /* styles applies to both <body> and class="all" */ } Or you could just apply the styles to body. The <div> will inherit the styles automatically. @toolman - If you still need assistance, could you provide a little more information on what you're trying to accomplish? Link to comment https://forums.phpfreaks.com/topic/283927-select-body-tag-from-div-class/#findComment-1458457 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.