Help - Search - Members - Calendar
Full Version: Need help regarding code structure and remove redundancy
HTMLHelp Forums > Web Authoring > General Web Design
Revolution
I am really unsure how to handle the redundancy that is occurring so many times throughout the code. Like for instance, I am setting the height and background and all, and I just want the code in both style.css and guide.html to be so much cleaner. Have a look at the attachment, a .rar file with an html and css file, created this as a tool to help me in completing the visual novel "Clannad".
Revolution
Sorry, I was in a rush and accidentally uploaded the version where every picture was stored locally and not on an image hosting service, and now I don't have access to the updated file... Hang on in an hour, and I'll update it
Revolution
I actually can't delete a post nor reply? Oh well, here is the new .rar file:

https://www.dropbox.com/s/9100dqydydev65l/Website.rar?dl=0
Revolution

The website isn't supporting anything below 1920x1080 in google chrome, because I am the only one who's gonna use this tool anyway, but I'll explain some key points that I haven't mentioned yet:

1. I will do jQuery to make the buttons at the top display the separate people's route, and have information pop up in the opaque black box about the different days in the visual novel as it advances when I click the different days on the left.
2. To rephrase, what I'm asking is that I want to write the properties in the style.css file as few times as possible, all the days have that same background, the same size and more - yet I was not potent enough to find a way to make one selection do the wonder.
3. I am really new to the division of content, so I don't really know if I need to set an id for each and every one of the days that are listed. The boxes with the names looked like they required an id because of the individual coloring.

Every improvement, no matter the importance, is appreciated!
Christian J
Not sure where this topic fits best, I'll try General Web Design...
CharlesEF
If I understand the question correctly you can combine CSS selectors for the common rules. Then you only need to define the selector for the specific rules for that selector. Example:
CODE
#sel1, #sel2, #sel3, #sel4{
  put all common rules here;
}

#sel1{
  put specific rules here;
}

#sel2{
  put specific rules here;
}

#sel3{
  put specific rules here;
}

#sel4{
  put specific rules here;
}

Also, you have an extra </div> at the end of your HTML.
Christian J
Off topic post moved to its own thread: http://forums.htmlhelp.com/index.php?showtopic=43793
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2021 Invision Power Services, Inc.