Hello there! I am looking to create a flexible HTML and CSS page that adjusts in size when the user resizes the browser window. I want the page to be responsive to different resolutions. I've explored various solutions on this platform, but unfortunately, none of them seem to work for me. I have also experimented with media queries.
Below is my current CSS and HTML code:
* {
margin: 0;
padding: 0;
}
body{
font-family: 'Francois One', Arial, Helvetica, sans-serif;
color: white;
text-align:center;
background:black;
}
.corpo{
margin-top: 5px;
margin-left: 400px;
margin-right: 250px;
float:middle;
}
header{
margin: 40px 0;
}
.menu li{
display: block;
float: left;
width: 125px;
height: 50px;
line-height: 50px;
text-align: center;
color: #2C3E50;
border-right: 1px solid #2C3E50;
background: -webkit-linear-gradient(top, #FFFF00 50%, #FFFF00 51%, #f6f6f6 100%);
background: -moz-linear-gradient(top, #FFFF00 50%, #FFFF00 51%, #f6f6f6 100%);
background: -o-linear-gradient(top, #FFFF00 50%, #FFFF00 51%, #f6f6f6 100%);
background: -ms-linear-gradient(top, #FFFF00 50%, #FFFF00 51%, #f6f6f6 100%);
border-color:black;
opacity:1;
position:relative;
}
.menu li:hover{
cursor: pointer;
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%);
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%);
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%);
background: -ms-radial-gradient(center, ellipse cover, #ffffff 0%, #e5e5e5 100%);
color: slateGrey;
border-color:black;
position:relative;
}
.primo{
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
.ultimo{
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
.sub-menu{
visibility: hidden;
}
.menu li:hover .sub-menu{
visibility: visible;
}
.sub-menu li{
border-top: 1px dotted #2C3E50;
}
.sub-menu li:hover{
width: 145px;
background: -webkit-radial-gradient(center, ellipse cover, #f7fbfc 10%, #add9e4 100%);
background: -moz-radial-gradient(center, ellipse cover, #f7fbfc 10%, #add9e4 100%);
background: -o-radial-gradient(center, ellipse cover, #f7fbfc 10%, #add9e4 100%);
background: -ms-radial-gradient(center, ellipse cover, #f7fbfc 10%, #add9e4 100%);
transition: all 0.1s ease 0s;
-webkit-transition: all 0.1s ease 0s;
-moz-transition: all 0.1s ease 0s;
-o-transition: all 0.1s ease 0s;
-ms-transition: all 0.1s ease 0s;
}
.ultimo-sub{
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.menu li a:link{
color:black;
text-decoration:none;
}
.menu li a:hover{
color:black;
text-decoration:none;
}
.menu li a:active{
color:black;
text-decoration:none;
}
.menu li a:visited{
color:black;
text-decoration:none;
}
p{
color: #FFFF00;
margin: 0px 380px 0px 400px;
font-size:150%;
text-shadow: 2px 0 0 #000, 0 -1px 0 #000, 0 2px 0 #000, -1px 0 0 #000; //text-shadow: 2px 0 0 #000, 0 -1px 0 #000, 0 2px 0 #000, -1px 0 0 #000;
}