As I begin my journey into front-end development, I am currently immersing myself in studying html, css, and vanilla javascript.
While things are going well so far, I find myself struggling with understanding the organization of design layouts in general. Responsive design has also become a challenge for me as I struggle to define a default layout correctly.
What are the best practices when it comes to this?
When using CSS GRID, should I stick to creating basic areas like header, nav, main, footer? Or should I delve deeper and create nested grids within div/section elements?
For example:
Should I define in CSS:
#main-grid{
display:grid;
grid-template-areas:
"nav nav"
"head head"
"bio bio"
"picture1 article1"
"article2 article2"
"picture2 picture2"
"article3 picture3"
grid-template-columns: auto auto;
or would it be better to simply declare a main content area (span 1) with CSS GRID and insert div elements inside in the HTML (using flexbox, float, adjusting width and height, etc.)?
#main-grid{
display:grid;
grid-template-areas:
"nav"
"head"
"main-content";
grid-template-columns: auto;
}
and #main-content in HTML:
<div>picture1 + article1 </div>
<div>article2 + picture2</div>
<div>article3 + picture3</div>
I understand that approaches can vary based on individual preferences and project requirements, but I believe there must be some best practices or default logic to follow. Any insights would be greatly appreciated!
Thank you!