Programming Forums
User Name Password Register

RSS Feed

Thread Tools Display Modes
Old Nov 1st, 2014, 1:54 PM   #1
code guy
Join Date: Dec 2012
Posts: 13
Rep Power: 0 code guy is on a distinguished road
CSS Classes

Hi, As part of my collage assignment I have to make a website (linked together with a navigation bar), and so to give all the webpages a consistent look I'm using a CSS class to apply the same css rules to div tags in the "AllContent" class, meaning the div tag that contains all the webpage content. I can get the CSS class to work for this class but I also have another div tag for sidebar elements (i.e. a selection of text items), and the CSS rules don't have an effect on the div tags in the "sidebar" class. I've programmed this class exactly the same as the "AllContent" class, so how come it doesn't work for the second class? Thanks.

CSS code:
width: 1024px;
margin-left: auto;
margin-right: auto;
background-color: #e0e0e0;

background-color: #c0c0c0;

display: inline;

// style settings for the sidebar of each webpage (all sidebars will follow
// these style rules)
float: left;
background-color: #ffffff;

display: block;

HTML code:
<link rel="stylesheet" type="text/css" href="../Website CSS/Website CSS.css">


<div class="AllContent">
<!-- This is the navigation bar, it has been centred and is dependant on -->
<!-- the external CSS file, each item links to the first page in the folder -->
<li><a href="../Home/Home.html">Home</a></li>
<li><a href="../Info/Band1.html">Info</a></li>
<li><a href="../Booking.html">Booking</a></li>
<li><a href="../About/History.html">About</a></li>
<li><a href="../Contact Us/Customer Queries.html">Contact Us</a></li>

<h5>Info: Band #1</h5>

<div class="sidebar">
<li class="sidebar">Band #1</li>
<li class="sidebar">Band #2</li>
<li class="sidebar">Band #3</li>
<li class="sidebar">Band #4</li>
<li class="sidebar">Band #5</li>
<li class="sidebar">Festival Site Map</li>
<li class="sidebar">Shops</li>
<li class="sidebar">Activities</li>
<li class="sidebar">Dining</li>
<li class="sidebar">Accommodation</li>
<li class="sidebar">Health and Safety</li>




code guy is offline   Reply With Quote


« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Meh some Classes! squills C++ 9 Jun 10th, 2013 5:39 PM
DJANGO USERS NEED YOUR HELP! How can I incorporate CSS into Django jahelmie Python 1 Jul 18th, 2011 2:02 PM
Combine CSS files Panos Project Ideas 1 Jun 28th, 2009 12:55 PM
Should I Be Using Static Classes? King C# 3 May 12th, 2009 8:47 AM
Could some please explain classes to me... TCStyle C++ 10 Feb 20th, 2006 4:51 PM

DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:56 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC