Making div content responsive

后端 未结 3 1016
耶瑟儿~
耶瑟儿~ 2021-02-05 21:10

My content isn\'t responsive at the moment. I\'ve tested it on iPhone and the text goes over the screen.

I\'ve changed the CSS of my container to:

#conta         


        
3条回答
  •  忘掉有多难
    2021-02-05 21:32

    try this css:

    /* Show in default resolution screen*/
    #container2 {
    width: 960px;
    position: relative;
    margin:0 auto;
    line-height: 1.4em;
    }
    
    /* If in mobile screen with maximum width 479px. The iPhone screen resolution is 320x480 px (except iPhone4, 640x960) */    
    @media only screen and (max-width: 479px){
        #container2 { width: 90%; }
    }
    

    Here the demo: http://jsfiddle.net/ongisnade/CG9WN/

提交回复
热议问题