-
How to do styling of a page header layout to fit in tablet & smart phones?
about 7 years ago
-
about 7 years ago
Make below change in your CSS, I hope this will work for you, which you want to achieve.
<style> body { background-color: #d1d1d1; direction: rtl; } .header { border: #222 double; /*width: 100%; display: inline-table; height: 20px; min-width: 980px;*/ background-color: #4c4e5a; } .header::after{ clear: both; content: ""; display: block; } .header .div1 { *background-color: skyblue; width: 25%; float: right; /*float: left;*/ } .div2 { *background-color: burlywood; width: 50%; float: right; margin: 0 auto; /*float: left;*/ } .div2, .div2 ul, .div2 li, .div2 a { margin: 0; padding: 0; border: none; outline: none; } .div2 ul { height: 40px; /*width: 505px;*/ margin: 5px auto; background: #4c4e5a; background: -webkit-linear-gradient(top, #4c4e5a 0%, #2c2d33 100%); background: -moz-linear-gradient(top, #4c4e5a 0%, #2c2d33 100%); background: -o-linear-gradient(top, #4c4e5a 0%, #2c2d33 100%); background: -ms-linear-gradient(top, #4c4e5a 0%, #2c2d33 100%); background: linear-gradient(top, #4c4e5a 0%, #2c2d33 100%); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .div2 li { position: relative; list-style: none; float: right; display: block; height: 40px; } .div2 li a { display: block; padding: 0 14px; margin: 6px 0; line-height: 28px; text-decoration: none; border-left: 1px solid #393942; border-right: 1px solid #4f5058; font-family: Helvetica, Arial, sans-serif; font-weight: normal; font-size: 18px; color: #f3f3f3; text-shadow: 1px 1px 1px rgba(0, 0, 0, .6); -webkit-transition: color .2s ease-in-out; -moz-transition: color .2s ease-in-out; -o-transition: color .2s ease-in-out; -ms-transition: color .2s ease-in-out; transition: color .2s ease-in-out; } .div2 li:first-child a { border-left: none; } .div2 li:last-child a { border-right: none; } .div2 li:hover>a { color: #8fde62; } .div3 { *background-color: gainsboro; width: 25%; float: left; } .div3 .dropdown { margin-top: 15px; } /* DropDown */ .dropdown { color: #555; margin: 3px -22px 0 0; width: 143px; position: relative; height: 17px; text-align: left; } .submenu { position: absolute; z-index: 100; width: 135px; display: none; margin-left: 10px; padding: 40px 0 5px; border-radius: 6px; } .dropdown li a { color: #555555; display: block; font-family: arial; font-weight: bold; padding: 6px 15px; cursor: pointer; text-decoration: none; } .dropdown li a:hover { background: #155FB0; color: #FFFFFF; text-decoration: none; } a.account { font-size: 18px; line-height: 16px; color: #fff; position: absolute; z-index: 110; display: block; padding: 11px 0 0 20px; height: 28px; width: 150px; margin: -11px 0 0 -10px; text-decoration: none; background: url(images/arrow.png) 80px 32px no-repeat; cursor: pointer; } .root { list-style: none; font-size: 11px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); background: #fff; padding: 10px 0 10px 0; border-radius: 5px 5px 5px 5px; margin: 21px 0 0 0; } .root:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: #ffffff; position: absolute; color: #ffffff; top: 54px; right: 17px; } /* DropDown */
-
1 Answer(s)