Quite a bit of the resonsive designs in v14 appear ti have been built using the flex family of styles. http://www.w3schools.com/cssref/css3_pr_flex.asp
This method seems, however, not to work in firefox. I know many mobile devices do not primarily use FF as a browser although it is an option on iOs and android. Even the ZTE Firefox phone does not use FF as a default browser. It is worth bearing this in mind when using the FF developer tools responsive view.
I was having a play with flex to be able to custom edit some layouts and here is wher I am so far. Any suggestions on improvement welcome. The Media queries are a bit of a dogs dinner but they seem to work.
CSS
html
[BImage[/B]
URL
www.graphicz.gb.com/flex/
Thanks for looking and advice.
This method seems, however, not to work in firefox. I know many mobile devices do not primarily use FF as a browser although it is an option on iOs and android. Even the ZTE Firefox phone does not use FF as a default browser. It is worth bearing this in mind when using the FF developer tools responsive view.
I was having a play with flex to be able to custom edit some layouts and here is wher I am so far. Any suggestions on improvement welcome. The Media queries are a bit of a dogs dinner but they seem to work.
CSS
Code:
.jc-container { float:left; width:100%; margin:0 0 1%; padding:1%; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-flow: row wrap; justify-content: space-around; } .jcSection { border: 1px solid red; float:left; width:98%; display:-webkit-flex; display:-moz-flex; display:flex; -webkit-flex-flow:row wrap; -moz-flex-flow:row wrap; flex-flow:row wrap; /* Start of IE Flex box */ display: -ms-flexbox !important; -ms-flex-direction: row !important; -ms-flex-wrap:wrap !important; /* End of IE Flex box */ } .jcSection2 { border: 1px solid red; -webkit-flex:0 0 45%; -moz-flex:0 0 45%; flex:0 0 45%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:45%; width:45%; /* End of IE Flex box */ margin:1% auto; } .jcSection3 { border: 1px solid red; -webkit-flex:0 0 30%; -moz-flex:0 0 30%; flex:0 0 30%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:30%; width:30%; /* End of IE Flex box */ margin:1% auto; } .jcSection4 { border: 1px solid red; -webkit-flex:0 0 23%; -moz-flex:0 0 23%; flex:0 0 23%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:23%; width:23%; /* End of IE Flex box */ margin:1% auto; } .jc-container img, .jc-container.jcSection2 img, .jc-container.jcSection3 img, .jc-container.jcSection4 img {max-width:100%!Important;height:auto; max-height:inherit;} /* #### Desktops #### */ @media screen and (min-width: 1024px){ .jc-container { float:left; width:100%; margin:0 0 1%; padding:1%; list-style: none; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-flow: row wrap; justify-content: space-around; } .flex-item { background: tomato; padding: 5px; width: 200px; height: 150px; margin-top: 10px; line-height: 150px; color: white; font-weight: bold; font-size: 3em; text-align: center; } .jcSection { border: 1px solid red; float:left; width:98%; display:-webkit-flex; display:-moz-flex; display:flex; -webkit-flex-flow:row wrap; -moz-flex-flow:row wrap; flex-flow:row wrap; /* Start of IE Flex box */ display: -ms-flexbox !important; -ms-flex-direction: row !important; -ms-flex-wrap:wrap !important; /* End of IE Flex box */ } .jcSection2 { -webkit-flex:0 0 45%; -moz-flex:0 0 45%; flex:0 0 45%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:45%; width:45%; /* End of IE Flex box */ margin:1% auto; } .jcSection3 { -webkit-flex:0 0 30%; -moz-flex:0 0 30%; flex:0 0 30%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:30%; width:30%; /* End of IE Flex box */ margin:1% auto; } .jcSection4 { -webkit-flex:0 0 23%; -moz-flex:0 0 23%; flex:0 0 23%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:23%; width:23%; /* End of IE Flex box */ margin:1% auto; } } /* #Tablet (Portrait) ================================================== */ /* Note: Design for a width of 768px */ @media only screen and (min-width: 768px) and (max-width: 959px) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /* #Mobile (Portrait) ================================================== */ @media only screen and (max-width: 767px), @media screen and (max-device-width: 480px) and (orientation: portrait){ .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /* #Mobile (Landscape) ================================================== */ /* Note: Design for a width of 480px */ @media only screen and (min-width: 480px) and (max-width: 767px), @media screen and (max-device-width: 640px) and (orientation: landscape){ .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /* #### Mobile Phones Portrait or Landscape #### ================================================== */ @media screen and (max-device-width: 640px), @media screen and (max-device-width: 414px){ .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /* #### iPhone 4+ Portrait or Landscape #### ================================================== */ @media screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2){ .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /* #### Tablets Portrait or Landscape #### ================================================== */ @media screen and (min-device-width: 768px) and (max-device-width: 1024px){ .jcSection2 { -webkit-flex:0 0 45%; -moz-flex:0 0 45%; flex:0 0 45%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:45%; width:45%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 30%; -moz-flex:0 0 30%; flex:0 0 30%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:30%; width:30%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 23%; -moz-flex:0 0 23%; flex:0 0 23%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:23%; width:23%; /* End of IE Flex box */ } } /*=== New iPhone Stuff ===*/ /*– iPhone 5, iPod Touch 5Gen– ================================================== */ @media only screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width:1136px) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /*– iPhone 5, iPod Touch 5Gen– landscape ================================================== */ @media only screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width:1136px) and (orientation : landscape) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /*– iPhone 4, 4S, 5, iPod Touch 4Gen, 5Gen– Portrait ================================================== */ @media only screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width:640px) and (orientation : portrait) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /*iPhone 6 (Standard View) and iPhone 6 Plus (Zoom View): ================================================== */ @media screen and (max-device-width: 375px) and (max-device-height: 667px) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /*iPhone 6 Plus (Standard View): ================================================== */ @media screen and (max-device-width: 414px) and (max-device-height: 776px) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /*iPhone 6 (Zoom View): ================================================== */ @media screen and (max-device-width: 320px) and (max-device-height: 568px) { .jcSection2 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection3 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } .jcSection4 { -webkit-flex:0 0 100%; -moz-flex:0 0 100%; flex:0 0 100%; /* Start of IE Flex box */ -ms-flex-grow:0; -ms-flex-shrink:0; -ms-flex-basis:100%; width:100%; /* End of IE Flex box */ } } /*=== New iPhone Stuff ENDS ===*/ /* #Clearing ================================================== */ /* Self Clearing Goodness */ .container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } /* Use clearfix class on parent to clear nested columns, or wrap each row of columns in a <div class="row"> */ .clearfix:before, .clearfix:after, .row:before, .row:after { content: '\0020'; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; } .row:after, .clearfix:after { clear: both; } .row, .clearfix { zoom: 1; } /* You can also use a <br class="clear" /> to clear columns */ .clear { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; }
Code:
<p>xxx</p> <div class="jc-container"> <div class="jcSection2">1 <img src="tulips600.jpg" alt="Tulips" width="600" height="333" /></div> <div class="jcSection2">2</div> </div> <p>xxx</p> <div class="jc-container"> <div class="jcSection">1 <img src="tulips600.jpg" alt="Tulips" width="600" height="333" /></div> </div> <p>xxx</p> <div class="jc-container"> <div class="jcSection3">1 <img src="tulips600.jpg" alt="Tulips" width="600" height="333" /></div> <div class="jcSection3">2</div> <div class="jcSection3">3</div> </div> <p>xxx</p> <div class="jc-container"> <div class="jcSection4">1 <img src="tulips600.jpg" alt="Tulips" width="600" height="333" /></div> <div class="jcSection4">2</div> <div class="jcSection4">3</div> <div class="jcSection4">4</div> </div>
URL
www.graphicz.gb.com/flex/
Thanks for looking and advice.
Comment