Bert Coules Posted November 25, 2014 Share Posted November 25, 2014 (edited) My newly-revamped site is now live at http://www.bertcoules.co.uk . Thanks again for all the help. I ran the coding through the W3C markup validator. It picked up this in index.php which is reported as a "Duplicate ID" error: <div id="caption_bar"> <p class="caption"> Sherlock Holmes </p> </div> <div id="caption_bar"> <p class="caption"> A Wizard of Earthsea </p> </div> <div id="caption_bar"> <p class="caption"> Lost Empires </p> </div> <div id="caption_bar"> <p class="caption"> Mutiny on the Bounty </p> </div> Is this bad practice? It certainly seems to work, and does exactly what I want it to, with the "caption_bar" set to span a quarter of the overall width of the display, but is there a more legitimate way of doing it? Many thanks. Edited November 25, 2014 by Bert Coules Link to comment Share on other sites More sharing options...
Ingolme Posted November 25, 2014 Share Posted November 25, 2014 Yes, there's a better way. Use a class name instead of an id. <div class="caption_bar"> The purpose of an ID is to identify a single unique item on the page. If you scroll just a bit further on this page you'll find the class selector: http://www.w3schools.com/css/css_selectors.asp Link to comment Share on other sites More sharing options...
Bert Coules Posted November 25, 2014 Author Share Posted November 25, 2014 (edited) Thanks. I didn't realise that you could only have one instance of a particular div per page. I'll redo it using a class name. Edited to add: Now done, and works perfectly. Thanks again. Edited November 25, 2014 by Bert Coules Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now