Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS White Space

RobertWA

Active Coder
I read that extra white space in a CSS file can slow my website and a process called Minify can remove these. Is that significantly helpful? And does the same apply to my HTML files where I have deliberately included extra white space to improve its readability eg for editing

Thanks in advance

Robert
 
I use a lot of white space and comments when I program. I want to save this information for the time when I need to change, add, or remove things from the webpage. I save this blotted page on my computer or as an information file on the server. It is also good to keep a file of the changes and the line numbers changed. Both the old code and the new. Minification will remove the empty lines and the comments making the file smaller and therefore faster to load. It's a good thing to do just remember to keep records.
 
Thank you for your help on these two questions. But can you also help with my third query - will my users have a faster experience if I break my large html file into several smaller linked html files?
 
That all depends on how things are done. If you post on the landing page that "You have three means of transportation, A Ferrari, a three-speed bicycle, and a bass boat; click to see how each is used and why. And when you read about the bicycle you have to hit the back button to link to the car, etc. Then I'd say that was not good, but if you could go to the Ferrari page from the bicycle page then good.

If you made a 27 chapter book and each chapter flowed to the next - good. But if you stopped reading in chapter 18 and when you returned to the site you had to go through all 17+ chapters to get to where you left off - bad.

And about the vehicles - if you only had a couple of sentences to say about each, it would be better to have everything on one page.

What is your large file about and how are you thinking of splitting it?
 
Thank you.

My website is for my family history and the file in question traces one branch of the family through several generations and several family members. I think it is too long for a single reading. (There will be other files with the same problem.)

I am concerned that a large file, which contains a lot of pictures, may be too slow to load. My pages are designed so that the content (the story) occupies the middle two-thirds of the screen with mostly blank columns down both sides. The left column contains a menu with buttons which link to the parts of the story, in sequence. The right column just contains “housekeeping” buttons, eg to return to the top of the document or go back to my introductory (index) page or contact me by email etc. Both of these menus stay on the screen at all times.

I am considering two approaches.

Method 1. Put my story into one html file and include bookmarks at the start of each section (new generation or new person) and my menu items will link to those bookmarks.

Method 2. Put my story into several html files (perhaps one per generation or one per person) and my menu items will link to each of the smaller html files. In this case I could include at the end of each file a link to the next file so that the reader could just continue reading as if it were just a single (large) file.

I suspect that some readers will want to read the whole document from go to whoa, whereas others will want to pick and choose the bits they want to read. But whichever way they approach it I feel sure that most will come back to the story on more than one occasion simply because it will be too much for a single sitting.

(That last paragraph makes it sound as though my story is a best-seller with people clamouring to read it! In reality my readership is likely to be limited to a handful of my relatives and a few others who may be interested.)

I am leaning towards Method 2 because I think that loading individual smaller files will be faster overall than loading a large file every time someone wants to read part of the story. However that might be too simplistic as I have no idea about the impacts of the links on the speed for the user.

Thanks again.

Robert
 
There are a number of apps that measure file load times. I believe Google Analytics does. I vote for Method 2 also and you could have thumbnails of the family members on the left that tells more about the individual in the photo when clicked.

Happy programming,
I wish you luck. If you run into any problems we're always here.
 
Back
Top Bottom