Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
CSS
.banner{
        position:relative;
        display: block;
        margin: auto;
        width:75%;
        top:23px;
           
    }
    #Username{
        position:relative;
        display: inline-block;
        width:auto;
        float:right;
        text-size-adjust: auto;
        padding-left: 5px;
        padding-right: 5px;
        min-width:auto;
        font-size : 100%;
        
    }
    #class1{
        
        position:relative;
        display:inline-block;
        margin:auto;
        top:68px;
        width:20%;
        float:left;
        padding-left:5px;
        padding-right:5px;
    }
    #class2{
        position:relative;
        display: inline-block;
        margin:auto;
        padding-left:5px;
        padding-right:5px;
        top:68px;
        width:20%;
        float:right;
    }
            /* for 1024px or less */
@media screen and (max-width: 1024px) {

	.banner{
		width: 94%;
	}
	#Username{
		width: 15%;
        top:40px;
	}
	#class1{
		width: 30%;
        top:100px;
	}
    #class2{
		width: 30%;
        top:100px;
	}
}
     /* for 736px or less */
@media screen and (max-width:736px) {

	.banner {
		width: 80%;
		float: center;
	}
	#Username {
		width:30%;
        top:30px;
		float: right;
	}
    #class1{
		width: auto;
        top:100px;
        float:left;
	}
    #class2{
		width: auto;
        top:100px;
        float:right ;
        left:30%;
	}
    
}


What I have tried:

I have followed some tutorials on the Internet but I just still don't know how to make all my things on the website change when screen size changes. When I narrow the screen, it runs successfully at the beginning, but failed in the end. How can I improve my code?
Posted
Updated 16-Nov-17 13:23pm
v2
Comments
Bryian Tan 16-Nov-17 19:24pm    
How about look into bootstrap Grid Template for Bootstrap[^]
Member 13525486 17-Nov-17 11:00am    
Can anyone offer help to me? Can someone help edit my code?
Member 10212775 10-Jan-18 6:35am    
provide your html code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900