Need help regarding code structure and remove redundancy |
Need help regarding code structure and remove redundancy |
Revolution |
Mar 28 2016, 02:06 PM
Post
#1
|
Group: Members Posts: 4 Joined: 28-March 16 Member No.: 24,107 |
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) Website.rar ( 1.43k ) Number of downloads: 1118 |
Revolution |
Mar 28 2016, 03:23 PM
Post
#2
|
Group: Members Posts: 4 Joined: 28-March 16 Member No.: 24,107 |
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 |
Mar 28 2016, 03:50 PM
Post
#3
|
Group: Members Posts: 4 Joined: 28-March 16 Member No.: 24,107 |
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 |
Mar 28 2016, 03:57 PM
Post
#4
|
Group: Members Posts: 4 Joined: 28-March 16 Member No.: 24,107 |
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 |
Mar 28 2016, 07:17 PM
Post
#5
|
. Group: WDG Moderators Posts: 9,667 Joined: 10-August 06 Member No.: 7 |
Not sure where this topic fits best, I'll try General Web Design...
|
CharlesEF |
Mar 28 2016, 08:15 PM
Post
#6
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
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. This post has been edited by CharlesEF: Mar 28 2016, 08:19 PM |
Christian J |
Mar 30 2016, 12:31 PM
Post
#7
|
. Group: WDG Moderators Posts: 9,667 Joined: 10-August 06 Member No.: 7 |
Off topic post moved to its own thread: http://forums.htmlhelp.com/index.php?showtopic=43793
|
Lo-Fi Version | Time is now: 21st May 2024 - 10:24 AM |