Monday, September 14Digital Marketing Journals

Tag: Refactoring

Refactoring HTML and CSS – 1stWebDesigner
building website, creating a website, CSS, google web designer, HTML, internet design, Learn, web design, web design company, web designer, web page design, website builder, website design

Refactoring HTML and CSS – 1stWebDesigner

Something that happens often when adding content and styles to our web projects is inadvertently using too much HTML markup. For example, the <div> element is often used to group or wrap elements to add CSS to them. But it’s not always necessary to throw a <div> around the element that needs to be styled. Every HTML element is its own box and can be styled. In this example, the CSS style will look the same whether you add it to the <h1> element or its container element. But you can and should use a <div> and other container elements (e.g. <header>) when multiple elements need to be grouped. Just remember to only add what you need and use semantic HTML tags instead if a <div>, when it makes sense to do so. In the example below, I’ve removed the extra <...