Giter Club home page Giter Club logo

html-css-refactor's Introduction

Consultation website code refactoring

Dev log: 17 September 2020
deployed page: https://coryjquirk.github.io/HTML-CSS-refactor/

I was given the task of reducing this business page's redundant code down to less lines while maintaining the exact same visual look. To do this, I consolidated multiple CSS classes that provided the same visual attributes but could be combined to be used multiple times. I brought the CSS code down from 200 lines to 130 lines.

I created a new class in CSS called search-online-social that combined these three classes into one class: search-engine-optimization, online-reputation-management, and social-media-marketing. The same applied for the h2 and img classes for these three sections.

The HTML code went from 82 to 122 lines. This is because I took to reorganizing the HTML to make it easier for me to read and work with. This involved hitting the return key and the tab key to get my code organized in a way that seemed more logical to me, and in a way that visually represented how the HTML elements were nested within each other. I introduced semantic tags for the header and footer to separate them from the body in my HTML file.

The code had a few mistakes to be remedied as well, such as missing alt tags for images, the header missing a website title, and the old code using instead of having a self closing tag. The link at the top for the "Search Engine Optimization" was broken, but this was a simple fix as the other two similarily styled links were working.

Next time I could have done a better job organizing the code in my CSS file. I spent about a half hour toying with a header labelled h2, befuddled as to why it the margins wouldn't adjust as I expected, only to find that I had a duplicate of another h2 tag hiding at the bottom of my code that was conflicting with the first one I was editing. I discovered this when using the ctrl-f to take inventory of all of my margin proerties being used.

I found the benefits section to be the most difficult section to work with. However, after some trial and error, I was able to consolidate all the benefit-xxx/img/h3 classes into just three (benefits, benefits-img, and h4).

Next time I would reduce my use of the ctrl-/ "note out" function, because it caused a lot of extra clutter that made my CSS code harder to read. Next time I think it will be more helpful to keep an eye on my active code instead of the leftover junk getting in the way. I had a much easier time organizing my HTML file into an easy to read and follow structure compared to my CSS file.

html-css-refactor's People

Contributors

coryjquirk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.