snippethtmlMinor
How can I improve the following code using HTML5 and CSS3?
Viewed 0 times
cantheandimprovefollowinghtml5usinghowcodecss3
Problem
Using the Flat Web Design Tutorial offered at 1webdesigner I tried converting the resulting PSD file to HTML5 and CSS3. While attempting to use sectioning elements in the markup I quickly found myself lost in how to maintain semantic code while also adhering to the original design. As a result there are more div tags than I initially desired. How can I achieve the same result using the HTML5 sectioning elements?
If you notice any other areas that could use improvement, please don't hesitate to point them out.
Demo
HTML
```
John Doe | Web & Graphic Designer
Home
Services
Portfolio
Blog
Hire me
Holla.
I'm John Doe a Philippines-based web & graphic designer who creates
clean and modern design for the world of web.
View my work
Web Design
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Learn more
Mobile Design
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Learn more
Photography
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Learn more
If you notice any other areas that could use improvement, please don't hesitate to point them out.
Demo
HTML
```
John Doe | Web & Graphic Designer
Home
Services
Portfolio
Blog
Hire me
Holla.
I'm John Doe a Philippines-based web & graphic designer who creates
clean and modern design for the world of web.
View my work
Web Design
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Learn more
Mobile Design
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Learn more
Photography
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.
Learn more
Solution
I find the CSS too low level for a good design.
Do you really want to declare the same style for all 'h2' tags?
Then you may not like it for some of them and will redeclare.
Then redeclare again. Then the mess will grow over you. :)
I rather prefer semantic approach. Give your declarations to meaningful classes. Don't use tag declarations unless they mean anything to you.
Just my view.
EDIT. Using tag declarations carry further problems. What if you decide to change 'h3' to 'h4'? Or to something else? Do you want to copy over all your declarations each time?
Do you really want to declare the same style for all 'h2' tags?
Then you may not like it for some of them and will redeclare.
Then redeclare again. Then the mess will grow over you. :)
I rather prefer semantic approach. Give your declarations to meaningful classes. Don't use tag declarations unless they mean anything to you.
Just my view.
EDIT. Using tag declarations carry further problems. What if you decide to change 'h3' to 'h4'? Or to something else? Do you want to copy over all your declarations each time?
Context
StackExchange Code Review Q#37284, answer score: 3
Revisions (0)
No revisions yet.