2013-07-03 15 views
8

मैं स्मार्टफ़ोन अभिविन्यास और डेस्कटॉप के लिए अलग-अलग मीडिया प्रश्न सेट करने का प्रयास कर रहा हूं, मैं चित्र और परिदृश्य को लक्षित करना चाहता हूं। मैं सभी अन्य ढेर लिंक के बारे में पता कर रहा हूँ इस तरह के होते हैं:मीडिया प्रश्न?

Desktop css first 
    -- csss for desk -- 

Portrait: 

    @media only screen and (min-device-width: 320px) and (max-device-width: 479px) { 
    body { 
     padding: 0 !important; 
    } 
    .infoShowWrapper { 
     width: 268px; 
    } 
    .heroImage { 
     margin-top: 0; 
     height: 200px; 
     width: 100%; 
     background: #fff url(assets/images/hero_small.jpg) no-repeat center center; 
    } 
    .navbar-fixed-top { 
     margin: 0 !important; 
    } 
    .box-item { 
     width: 280px; 
    } 
    .seaBkg { 
     background-image: url(assets/images/mare_2x.jpg); 
    } 
} 

Landscape: 

    @media only screen and (min-device-width: 480px) and (max-device-width: 640px) { 
    body { 
     padding: 0 !important; 
    } 
    .heroImage { 
     margin-top: 0; 
     height: 200px; 
     width: 100%; 
     background: #fff url(assets/images/hero_small.jpg) no-repeat center center; 
    } 
    .navbar-fixed-top { 
     margin: 0 !important; 
    } 
    .box-item { 
     width: 440px; 
    } 
    .infoShowWrapper { 
     width: 440px; 
    } 
    .seaBkg { 
     background-image: url(assets/images/mare_2x.jpg); 
    } 
} 
:

Media query to target most of smartphone 3 media queries for iphone portrait, landscape and ipad portrait

लेकिन मैं अभी भी मुद्दों, मेरे परिदृश्य एक काम नहीं कर रहा हो रहा है, इस कोड मैं का उपयोग कर रहा है

परिदृश्य कोड भी विचार नहीं किया जा रहा है की तरह है

उत्तर

18

जोड़ने का प्रयास करें

orientation : landscape 

@media only screen and (min-device-width: 480px) 
        and (max-device-width: 640px) 
        and (orientation: landscape) { 

//enter code here 
} 

संदर्भ के लिए this site या this snippet देखें।

+0

जोड़ना "और (अभिविन्यास: परिदृश्य)" डेस्कटॉप पर भी –

+0

पर प्रभाव डालेगा लेकिन चौड़ाई की घोषणा डेस्कटॉप को फ़िल्टर करेगी – Danield

+0

ठीक हैचाचा! धन्यवाद –

संबंधित मुद्दे