Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ General Web Design _ Need help regarding code structure and remove redundancy

Posted by: Revolution Mar 28 2016, 02:06 PM

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".


Attached File(s)
Attached File  Website.rar ( 1.43k ) Number of downloads: 1102

Posted by: Revolution Mar 28 2016, 03:23 PM

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

Posted by: Revolution Mar 28 2016, 03:50 PM

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

Posted by: Revolution Mar 28 2016, 03:57 PM


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!

Posted by: Christian J Mar 28 2016, 07:17 PM

Not sure where this topic fits best, I'll try General Web Design...

Posted by: CharlesEF Mar 28 2016, 08:15 PM

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.

Posted by: Christian J Mar 30 2016, 12:31 PM

Off topic post moved to its own thread: http://forums.htmlhelp.com/index.php?showtopic=43793

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)