I had a lot more trouble styling and positioning things than I thought I would. Could anyone please give me some pointers on media query’s? Or something to help this be more responsive?
Also any design input would be really helpful because it looks super boring and I’d love some tips
hi friend
firstly we will work in header section when you style as you like we go to other sections
1-in header section you should try this
<header>
<div id=“logo”>
<img …></div>
/* div with logo should contain only image */
<nav>…</nav>
</header>
in css
header {
position:fixed;
top:0;left:0;
} #logo{
float:left;
width:/*width you want */
}
nav{
float:right;width:required;
display:flex;flex-direction:row;
}
header::after{
display:table;clear:both;content:"";
}
for small devices @media screen and (max-width:768px){ #logo{
width:100%;
float:none;
}
nav{
float:none;width:100%;flex-direction:column;
}
}
2 - put this <meta name=”viewport” content=”width=device-width,initial-scale=1.0”>
in head section in the html paramatre
the banner image i have resizes but once it gets to a certain width it reveals the background which is a linear gradient gray that doesnt look so good.
hi friend you did good work you should resize the width of the iframe to 100% for extra small devices and for the images because in smaller devices it adds an horizantal srollbar
Edit: you also have a stray end curly bracket at the end of the CSS.
Click the down arrow on the top right side of the CSS box and use the Analyze CSS function from the drop-down menu. After you have fixed the errors use the Tidy CSS function.
Example: Line 45 Missed semicolon (because you have a colon instead of a semicolon).
hi @pdaford
to remove the horizontal scroll bar when the viewport smaller then 600px
1- for small devices you gave img a width with 100% in media declaration but doesn’t have any effect because .paper-pic with width=500px take advance
change the img selector in media declaration to .paper-pic and add !imporant to 100% of width value
and add box-sizing:border-box; to * selector this will resize all images to 100% of the viewport’s width
2- for the video
close the opening tag of div with id=“inner-box”
and change the property width of the #inner-box selector to max-width:600px;
resize the browser to see the difference
and when we are both online we will discuss other things
for the menu i don’t know how do you want to style it this is my personal portfolio
if you like my menu’styling we work together for yours https://codepen.io/ghellabsalah/pen/xgqQJV
remove display:flex and flex direction and give it a width of auto but with small device keep it 100% for nav selector
if you want to put nav item in horizontal in small devices decrease the padding of li and give it
flex-direction:row;and justify-content:space-between;
if you want to put them in a vertical
flex-direction:column;
I would say one thing to do for future projects is to go mobile first (media query min widths) as google penalizes websites that are not mobile first as web traffic continues more towards mobile browsing over desktop.