CSS to make the container DIV to cover full page - css

I am trying to convert a chat widget template so that:
The height and width of the container div are 100%.
A vertical scroll appears if the member list exceeds the screen size so that the user can scroll through the rest of the member list.
The textarea to type messages is visible all the time. Currently, the user has to scroll down to see it.
I have managed to achieve the first thing on my list but not the second and third. How would you do it?
Here is where I am at so far:
#import url(https://fonts.googleapis.com/css?family=Lato:400,700);
*, *:before, *:after {
box-sizing: border-box;
}
body {
background: #C5DDEB;
font: 14px/20px "Lato", Arial, sans-serif;
padding: 0;
color: white;
}
.container {
margin: 0 auto;
width: auto;
background: #444753;
border-radius: 5px;
}
.people-list {
width: 260px;
float: left;
}
.people-list .search {
padding: 20px;
}
.people-list input {
border-radius: 3px;
border: none;
padding: 14px;
color: white;
background: #6A6C75;
width: 90%;
font-size: 14px;
}
.people-list .fa-search {
position: relative;
left: -25px;
}
.people-list ul {
padding: 20px;
height: 770px;
}
.people-list ul li {
padding-bottom: 20px;
}
.people-list img {
float: left;
}
.people-list .about {
float: left;
margin-top: 8px;
}
.people-list .about {
padding-left: 8px;
}
.people-list .status {
color: #92959E;
}
.chat {
width: auto;
float: left;
background: #F2F5F8;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
color: #434651;
}
.chat .chat-header {
padding: 20px;
border-bottom: 2px solid white;
}
.chat .chat-header img {
float: left;
}
.chat .chat-header .chat-about {
float: left;
padding-left: 10px;
margin-top: 6px;
}
.chat .chat-header .chat-with {
font-weight: bold;
font-size: 16px;
}
.chat .chat-header .chat-num-messages {
color: #92959E;
}
.chat .chat-header .fa-star {
float: right;
color: #D8DADF;
font-size: 20px;
margin-top: 12px;
}
.chat .chat-history {
padding: 30px 30px 20px;
border-bottom: 2px solid white;
overflow-y: scroll;
height: 575px;
}
.chat .chat-history .message-data {
margin-bottom: 15px;
}
.chat .chat-history .message-data-time {
color: #a8aab1;
padding-left: 6px;
}
.chat .chat-history .message {
color: white;
padding: 18px 20px;
line-height: 26px;
font-size: 16px;
border-radius: 7px;
margin-bottom: 30px;
width: 90%;
position: relative;
}
.chat .chat-history .message:after {
bottom: 100%;
left: 7%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-bottom-color: #86BB71;
border-width: 10px;
margin-left: -10px;
}
.chat .chat-history .my-message {
background: #86BB71;
}
.chat .chat-history .other-message {
background: #94C2ED;
}
.chat .chat-history .other-message:after {
border-bottom-color: #94C2ED;
left: 93%;
}
.chat .chat-message {
padding: 30px;
}
.chat .chat-message textarea {
width: 100%;
border: none;
padding: 10px 20px;
font: 14px/22px "Lato", Arial, sans-serif;
margin-bottom: 10px;
border-radius: 5px;
resize: none;
}
.chat .chat-message .fa-file-o, .chat .chat-message .fa-file-image-o {
font-size: 16px;
color: gray;
cursor: pointer;
}
.chat .chat-message button {
float: right;
color: #94C2ED;
font-size: 16px;
text-transform: uppercase;
border: none;
cursor: pointer;
font-weight: bold;
background: #F2F5F8;
}
.chat .chat-message button:hover {
color: #75b1e8;
}
.online, .offline, .me {
margin-right: 3px;
font-size: 10px;
}
.online {
color: #86BB71;
}
.offline {
color: #cccccc;
}
.busy {
color: #E38968;
}
.me {
color: #94C2ED;
}
.align-left {
text-align: left;
}
.align-right {
text-align: right;
}
.float-right {
float: right;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}

This will do:
.chat .chat-history {
height: calc(100vh - 278px);
overflow-y: auto;
}
.people-list {
height: 100vh;
overflow-y: auto;
}
Updated codepen: https://codepen.io/anon/pen/BRxXmV

Related

My mediaqueries wont work even though i seperated it with its own stylesheet?

<div class="row iex-reepay">
<div class="col-lg-4 col-md-4">
<div class="after-element-pseudo">
<img src="/wp-content/uploads/sites/61/2018/10/iex-ikon-2.png" class="iex-icon"></div>
</div>
<div class="col-lg-4 col-md-4 col-lg-offset-1 col-md-offset-2"><img src="/wp-content/uploads/sites/61/2018/10/iex-ikon-2.png" class="reepay-icon"></div>
</div>
I have made a pseudo-class after element which works fine without media-queries.
When i start working responsive with my media-queries something goes wrong.
It seems like it only uses the after:element i made on large screen when media-queries is not needed.
I tried to separate my media-queries to their own stylesheet but the issue is still there. I tried to change a img size and nothing changes.
I really tried everything, validating my CSS etc.
#media screen and (max-width:1199px) {
.feature-icons-div {
margin-right: 38px;
}
.after-element:after {
content: "";
width: 55px;
height: 81px;
background-size: 55px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow-after-element.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
bottom: 36px;
right: -79px;
}
}
#media screen and (max-width:992px) {
.reepay div#manage-subscribtion-section section#themo_service_block_split_1 {
padding-top: 60px;
padding-bottom: 95px;
}
}
#media screen and (max-width:991px) {
.after-element {
position: relative;
}
.after-element-pseudo:after {
content: "";
width: 55px;
height: 81px;
background-size: 55px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow-after-element.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
bottom: 36px;
right: 42px;
}
img.reepay-icon {
max-width: 93px;
}
img.iex-icon {
max-width: 93px;
}
.iex-icons-div {
margin-top: 45px;
}
.reepay h2 {
color: #4f4f4f !important;
font-size: 24px;
}
.reepay div#manage-subscribtion-section section#themo_service_block_split_1 {
padding-top: 60px;
padding-bottom: 275px;
}
div#reepay-integeration-top section#themo_iex_block_visma_1 li p {
font-size: 20px;
}
div#reepay-integeration-top #themo_iex_block_visma_1 {
padding-top: 145px;
padding-bottom: 25px;
}
}
#media screen and (max-width:767px) {
.reepay h1 {
font-size: 34px;
}
img.subscribtion-image {
margin-top: 286px;
}
.reepay div#manage-subscribtion-section section#themo_service_block_split_1 {
padding-top: 60px;
padding-bottom: 106px;
}
.reepay .split-blocks .service-block p {
margin-left: 34px;
}
/*
.border-without-background-feature:after {
content: "";
width: 59px;
height: 81px;
background-size: 52px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow-after-element.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
top: 129px;
transform: rotate(89deg);
} */
.border-radius-for-iex:after {
content: "";
width: 59px;
height: 81px;
background-size: 52px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow-after-element.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
right: 58px;
transform: rotate(89deg);
/* bottom: -111px; */
top: 132px;
}
.iex-icons-div {
margin-left: 0;
}
.border-radius-for-iex {
display: inline-block;
height: 120px;
width: 120px;
border-radius: 50%;
background-color: #fff;
position: relative;
/* margin: auto 0; */
margin-left: 104px;
}
.border-without-background-feature {
position: relative;
display: inline-block;
margin-left: 96px;
}
}
#media screen and (max-width:540px) {
.reepay .split-blocks .service-block p {
margin-left: 14px;
}
.reepay h1 {
font-size: 24px;
}
div#order-right-now .iex-btnn {
background-color: #15d384;
border: none;
color: white;
padding: 14px 49px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
border-radius: 26px;
}
.reepay h2 {
color: #4f4f4f !important;
font-size: 20px;
}
div#order-right-now .iex-btnn {
background-color: #15d384;
border: none;
color: white;
padding: 14px 60px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
border-radius: 26px;
}
}
#media screen and (max-width:320px) {
img.center-block.reepay-header-dashboard {
padding-top: 35px;
padding-right: 22px;
}
.reepay h1 {
font-size: 24px;
}
div#reepay-integeration-top section#themo_iex_block_visma_1 li p:before {
content: "";
width: 55px;
height: 81px;
background-size: 25px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
left: -19px;
top: 6px;
}
div#reepay-integeration-top section#themo_iex_block_visma_1 li p {
font-size: 17px;
}
}
/* This is for all the h1 on the site */
.reepay h1 {
font-size: 37px;
}
/* This is for all the h2 on the site */
.reepay h2 {
color: #4f4f4f !important;
}
div#reepay-integeration-top em {
font-style: normal;
font-weight: 900;
font-size: 46px;
}
/* This is the header of the Reepay site start */
.reepay .navbar {
background-color: #fff;
margin-bottom: 0;
background-color: #0464ab !important;
}
.reepay .navbar .navbar-nav>li.active>a {
color: #fff;
text-transform: initial;
font-size: 20px;
}
.reepay html .navbar .navbar-nav>li>a:hover:after,
html .navbar .navbar-nav>li.active>a:after,
html .navbar .navbar-nav>li.active>a:hover:after,
html .navbar .navbar-nav>li.active>a:focus:after {
bottom: 5px;
background-color: #fff;
display: none;
}
.reepay .navbar .navbar-nav>li.active>a,
.navbar .navbar-nav>li.active>a:hover,
.navbar .navbar-nav>li.active>a:focus {
color: #fff;
}
.reepay .navbar-default {
background-color: #0464ab;
border-color: #0464ab;
}
/* This is the header of the Reepay site end */
/* Second section start */
div#reepay-integeration-top #themo_iex_block_visma_1 {
padding-top: 96px;
padding-bottom: 0px;
}
div#reepay-integeration-top li p {
margin-top: 12px;
}
div#reepay-integeration-top li {
list-style: none;
}
div#reepay-integeration-top section#themo_iex_block_visma_1 li p {
font-size: 23px;
}
div#reepay-integeration-top section#themo_iex_block_visma_1 li p:before {
content: "";
width: 55px;
height: 81px;
background-size: 25px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
left: -19px;
top: 16px;
}
img.center-block.reepay-header-dashboard {
padding-top: 35px;
}
/* This is the section for order now button */
div#order-right-now .iex-btnn {
background-color: #15d384;
border: none;
color: white;
padding: 14px 99px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
border-radius: 26px;
}
div#order-right-now section#themo_iex_brands_1 {
padding-top: 6px;
padding-bottom: 30px;
}
/* This is the section of manage-subscribtion */
div#manage-subscribtion-section p {
color: #4f4f4f;
font-size: 19px;
}
img.manage-subscribtion-icons {
margin-top: 30px;
}
.reepay div#manage-subscribtion-section section#themo_service_block_split_1 {
padding-top: 60px;
padding-bottom: 40px;
}
/* Remove the borders that i cant remove from the backend, i thuink it gets shout out from somewhere else to all subsites */
.reepay .border-wrap.top .border {
border-left: 2560px solid #e5e5e4;
border-top: 70px solid transparent;
border-right: 0 solid transparent;
border-bottom: 0 solid transparent;
display: none;
}
.reepay .border-wrap.bottom .border {
border-left: 2560px solid #e5e5e4;
border-top: 0 solid;
border-right: 0 solid transparent;
border-bottom: 70px solid transparent;
display: none;
}
.reepay section#themo_iex_testimonials_1 {
display: none;
padding-top: 5px;
padding-bottom: 5px;
}
/* This is the service-block section */
div#service-block-for-glyphicons h2 {
text-align: center;
margin-bottom: 50px;
padding-top: 15px;
}
div#service-block-for-glyphicons .service-blocks-horiz {
padding-top: 60px;
padding-bottom: 40px;
}
/* Feature page --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- */
div#feature-integeration-top section#themo_iex_block_visma_1 {
padding-top: 24px;
padding-bottom: 0px;
}
div#feature-integeration-top p {
font-size: 23px;
}
/* manage subscribtion for feature */
.border-radius-for-iex img {
position: absolute;
left: 28px;
top: 17px;
}
.border-radius-for-iex {
display: inline-block;
height: 120px;
width: 200x;
width: 120px;
border-radius: 50%;
background-color: #fff;
position: relative;
}
/* after element for the manage subscribtion feature page */
.reepay section#themo_html_1 {
padding-top: 8px;
padding-bottom: 275px;
}
.inner-wrapper {
background-color: #fff;
/* margin: auto 0; */
text-align: center;
}
.remove-bullet li:before {
content: "";
width: 55px;
height: 81px;
background-size: 25px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/Vector-Smart-Object-copy-3.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
left: -6px;
/* top: 18px; */
}
.inner-wrapper p {
font-size: 20px;
padding-bottom: -5px;
padding-bottom: 7px;
margin-bottom: 0px;
color: #2083c2;
}
.remove-bullet li {
color: #fff;
font-size: 15px;
margin-top: 20px;
padding-left: 9px;
}
.remove-bullet {
list-style: none;
}
#fff .remove-bullet li {
text-align: center;
}
.row.four-logo {
padding-top: 15px;
padding-bottom: 15px;
background-color: #fff;
margin-top: 24px;
}
img.uniconta {
max-width: 200px;
}
img.billy {
max-width: 190px;
}
img.dinero {
max-width: 190px;
}
img.economic {
max-width: 191px;
}
.row.iex-reepay {
text-align: center;
}
.after-element-pseudo:after {
content: "";
width: 55px;
height: 81px;
background-size: 55px 19px;
display: inline-block;
background-image: url(/wp-content/uploads/sites/61/2018/10/arrow-after-element.png);
background-repeat: no-repeat;
vertical-align: middle;
position: absolute;
bottom: 36px;
right: -61px;
}
.row.iex-reepay {
position: relative;
}
/* This is the section for the media queries */
Did you use your separated media-queries CSS link after main style? You have to use all responsive code after main style to get priority.

Media query not working without !important

My media query does not override the regular CSS unless I use !important all the time. What's the error? Here you can see the CSS with the !importants. If I remove them, the styling goes back to the regular CSS, even when the screen is less than 850px. Could you please help?
#media all and (min-width: 200px) and (max-width: 850px) {
html body {
position: absolute;
height: 100%;
width: 100% !important;
margin: 0 auto;
text-align:center;
}
#header {
background-color: white;
position: fixed;
top: 0px;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
width: 95%;
height: 120px;
z-index:9999;
}
#header-inner{
width: 100% !important;
float: right;
}
div#title {
margin: 0px !important;
position: absolute;
width: 100% !important;
height: 70px;
background: url('mobillogo.png');
background-repeat: no-repeat;
background-size: auto 70px;
}
.wrapper {
width: 100% !important;
overflow:auto;
margin-left: auto;
margin-right: auto;
}
#first {
padding-top: 150px;
padding-bottom: 30px;
overflow:auto;
width: 95%;
background-color: #f7fdff;
height: ;
}
#second {
margin-top: 65px;
overflow: auto;
width: 95% !important;
margin-bottom: 65px;
background-color: white;
}
#third {
overflow:auto;
width: 95% !important;
background-color: #f3efef;
padding-bottom: 4em;
}
#footer
{
height: 115px;
width:100% !important;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
background-color: white;
padding-top: 1em;
padding-bottom: 0.5em;
}
#footbox {
height: 70px;
width: 100% !important;
margin-top: 0px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
}
#contains {
width: 100% !important;
margin-top: 50px;
}
h1 {
float: left;
width: 100% !important;
margin-top: 2em;
font-family: Jersey;
font-size: 3.5em;
text-align: center;
color: #f44336;
}
#logo {
margin-top:70px !important;
width: 100% !important;
height: 70px;
}
div#logo img {
position: static !important;
height: 13vw !important;
}
#footbox {
height: 70px;
width: 95%;
margin-top: 0px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
}
#checklist {
overflow: auto;
position: relative;
float: left;
width: 100% !important;
font-family: 'Open Sans', sans-serif;
padding-bottom: 8vh;
padding-top: 15px;
text-align:left;
}
#short {
width: 100% !important;
color: black;
font-weight: bold;
font-size: 1.3em;
margin: 0px !important;
}
#form {
overflow: auto;
border-radius: 5px;
padding: 0px !important;
position: relative;
width: 100% !important;
display: inline-block;
-webkit-transition:background 0.3s;
-moz-transition:background 0.3s;
-o-transition:background 0.3s;
transition:background 0.3s;
transition-timing-function: ease-in-out;
}
ul.inline {
width: 100% !important;
list-style-type: none;
columns: 1 !important;
-webkit-columns: 1 !important;
-moz-columns: 1 !important;
list-style-position: inside;
padding: 0px;
margin: 0px;
}
#fulltext {
width: 90%;
padding-right: 30px;
}
.text {
width: 75% !important;
}
}
html body {
position: absolute;
height: 100%;
width: 100%;
margin: 0 auto;
text-align:center;
}
#font-face {
font-family: Jersey; src: url('Jersey M54.ttf');
}
p {
font-family: 'Open Sans', sans-serif;
text-align:left;
}
.lightup {
background-color: #ffc107;
}
button {
float: right;
margin-right: 10px;
font-size: 1.2em;
background: #5fbd5f;
color: white;
padding: 5px;
font-family: 'Open Sans', sans-serif;
color: white;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
border: 0;
outline: none;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
button:hover {
cursor: pointer;
cursor: hand;
}
button:active{
border: 0;
outline: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);ű
}
a, u {
text-decoration: none;
}
#header-inner{
width: 1100px;
float: right;
}
#header {
background-color: white;
position: fixed;
top: 0px;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
width: 100%;
height: 120px;
z-index:9999;
}
.wrapper {
overflow:auto;
width: 1100px;
margin-left: auto;
margin-right: auto;
}
#first {
padding-top: 150px;
padding-bottom: 30px;
overflow:auto;
width: 100%;
background-color: #f7fdff;
height: ;
}
#second {
margin-top: 65px;
overflow: auto;
width: 100%;
margin-bottom: 65px;
background-color: white;
}
#third
{
overflow:auto;
width: 100%;
background-color: #f3efef;
padding-bottom: 4em;
}
#footer
{
height: 115px;
width:100%;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
background-color: white;
padding-top: 1em;
padding-bottom: 0.5em;
}
#footbox {
height: 70px;
width: 1100px;
margin-top: 0px;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
}
#contains {
width: 100%;
margin-top: 50px;
}
#toTop {
clear:both;
width: 600px;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
font-family: 'Bree Serif', serif;
color: white;
border-radius: 5px;
background: #f44336;
padding-left: 15px;
padding-right: 15px;
font-size: 70px;
}
#logo {
float:left;
margin-top:1em;
}
h1 {
position: relative;
vertical-align: text-top;
margin-top: -12px;
font-family: Jersey;
font-size: 3.5em;
text-align: right;
color: #f44336;
}
h4 {
margin-top: 0px;
margin-bottom: 0;
font-family: Jersey;
font-size: 2em;
text-align: center;
color: white;
}
h5 {
position:relative;
float:left;
font-family: 'Open Sans', sans-serif;
color: #f44336;
font-size: 37px;
padding:5px;
width:250px;
margin-top: -15px;
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
text-align: right;
}
#purple {
text-align: center;
vertical-align: middle;
margin-top: 10px;
position:relative;
padding-right: 15px;
}
.caltxt {
padding-top: 0px;
padding-left: 15px;
font-size: 1em;
color: white;
}
#calendar {
margin-bottom: 5em;
margin-left: 80px;
float: left;
width: 600px;
height: 400px;
}
#sept {
float: left;
position: relative;
width: 25%;
height: 100%;
background-color: #4caf50;
}
#oct {
float: left;
position: relative;
width: 25%;
height: 75%;
background-color: #f44336;
}
#nov {
float: left;
position: relative;
width: 25%;
height: 75%;
background-color: #266fea;
}
#dec {
float: left;
position: relative;
width: 25%;
height: 75%;
background-color: #ffc107;
}
#plus {
float: left;
position: relative;
width: 75%;
height: 25%;
background-color: #9c27b0;
z-index: 0;
}
.calendar {
-webkit-transition: all 250ms;
-moz-transition: all 250ms;
transition: all 250ms;
}
.calendar:hover {
z-index: 9998;
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
-webkit-transform: translateY(-5px);
-moz-transform: translateY(-5px);
transform: translateY(-5px);
}
div#title {
margin-top: 50px;
position: absolute;
width: 1100px;
height: 70px;
background: url('weblogo.png');
background-repeat: no-repeat;
background-position: 0px;
background-size: auto 70px;
}
#checklist {
overflow: auto;
position: relative;
float: left;
width: 750px;
font-family: 'Open Sans', sans-serif;
padding-bottom: 8vh;
padding-top: 15px;
text-align:left;
}
#short {
width: 750px;
color: black;
font-weight: bold;
font-size: 1.3em;
}
#form {
overflow: auto;
border-radius: 5px;
padding: 15px;
position: relative;
width: 260px;
display: inline-block;
-webkit-transition:background 0.3s;
-moz-transition:background 0.3s;
-o-transition:background 0.3s;
transition:background 0.3s;
transition-timing-function: ease-in-out;
}
.text {
width: 90%;
text-align: left;
padding: 5px;
margin-top: 0px;
margin-bottom: 5px;
font-family: 'Open Sans', sans-serif;
border: 1px solid grey;
border-radius: 5px;
}
#fulltext {
width: 90%;
padding-right: 30px;
}
#name {
background: url(profile.png) no-repeat scroll 5px 5px;
background-color: white;
background-size: 20px;
margin-top: auto;
margin-bottom: auto;
padding-left:30px;
margin-bottom: 10px;
}
#email {
background: url(message.png) no-repeat scroll 5px 8px;
background-color: white;
background-size: 20px;
margin-top: auto;
margin-bottom: auto;
padding-left:30px;
margin-bottom: 10px;
}
#university {
background: url(university.png) no-repeat scroll 5px 4px;
background-color: white;
background-size: 20px;
margin-top: auto;
margin-bottom: auto;
padding-left:30px;
margin-bottom: 10px;
}
h3 {
font-family: 'Bree Serif', serif;
width: 130px;
color: white;
border-radius: 5px;
background: #f44336;
padding: 5px;
}
#textbox{
width: 90%;
height: 5em;
}
#textbox::-webkit-input-placeholder{
color:transparent;
}
#textbox::-webkit-input-placeholder::before {
color:#666;
content:"program?*";
}
h2 {
font-weight: bold;
font-size: 1em;
font-family: 'Open Sans', sans-serif;
}
ul.inline {
list-style-type: none;
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
list-style-position: inside;
padding: 0px;
margin: 0px;
}
ul.inline li {
padding: 5px;
background-image: url(check.png);
background-repeat: no-repeat;
background-size: 25px;
background-position: 0px center;
padding-left: 25px;
}
#fun {
float: left;
padding-bottom: 50px;
}
#creativity {
padding-bottom: 80px;
}
#community {
float: left;
margin-left: 75px;
}
#innovation {
float: left;
margin: 30px;
}
#challenge {
float: left;
margin-left: 100px;
margin-top: -25px;
margin-bottom: 5em;
height: 220px;
}
#csanad {
height: 130px;
float: left;
margin-left: 5%;
margin-top: 4%;
padding-bottom: 80px;
}
#adam {
height: 130px;
float: left;
margin-left: 0%;
margin-top: 70px;
}
#adamtxt {
font-size: 0.9em;
width: 61%;
float:left;
margin-top: 72px;
margin-left: 25px;
}
#rapper {
width:400px;
float: left;
}
#csanadtxt {
font-size: 0.9em;
width: 32%;
float:left;
margin-top: 4%;
margin-left: 25px;
}
#noura {
height: 130px;
float: left;
margin-left: 15px;
margin-top: 75px;
}
#nouratxt {
font-size: 0.9em;
width: 23%;
float:left;
margin-top: 80px;
margin-left: 25px;
}
#container {
}
div#logo img {
position: absolute;
height: 25px;
}
#menu{
position: relative;
padding: 0px;
float: right;
}
ul#menu li {
list-style: none;
display: inline-block;
font-size: 0.95em;
height: 1vw;
}
ul#menu li a {
padding: 5px;
padding-left: 0.45vw;
padding-right: 0.45vw;
color: #ff4412;
font-family: 'Open Sans', sans-serif;
outline: none;
text-transform: uppercase;
border-radius: 5px;
}
div#container div#header div#header-inner ul#menu li a:focus {
text-decoration: none;
}
div#container div#header div#header-inner ul#menu li a:hover {
background: #ff4412;
color: white;
text-decoration: none;
}
div#container div#header div#header-inner ul#menu li.highlight a {
color: white;
border-radius: 5px;
background: #ff4412;
}
div#container div#header div#header-inner ul#menu li.highlight:hover {
opacity: 0.9;
}
Explanation
How the browser see your CSS without !important:
for screen 200px < x < 800px do this {
bla bla bla
}
but... wait a second.. forget about it, do this for all screens {
bla bla bla
}
When you add !important the browser will take it like this:
for screen 200px < x < 800px do this {
bla bla bla
!do not listen to me if I will ever give you any other instructions
}
but... hey dude, want any instructions? Can you do this for all screens? {
bla bla bla
}
If you place #media block in the end of your file and remove all the !importants it will look like this:
for all screens do this {
bla bla bla
}
but for screens 200px < x < 800px do this {
bla bla bla
}
Demo
Open this snippet in full page mode and try to change browser's window size
#media (max-width: 800px) {
.bad {
background-color: green;
}
}
.bad, .good {
width: 100px;
height: 100px;
background-color: firebrick;
}
#media (max-width: 800px) {
.good {
background-color: green;
}
}
<div class="good"></div>
<div class="bad"></div>
Flip the order to place the media query later. It doesn't seem to add any selector weight, so the later one takes priority.
So you would have (snipped):
html body {
position: absolute;
height: 100%;
width: 100% !important;
margin: 0 auto;
text-align:center;
}
#media all and (min-width: 200px) and (max-width: 850px) {
html body {
position: absolute;
height: 100%;
width: 100% !important;
margin: 0 auto;
text-align:center;
}
}
See, for example, CSS specificity on MDN, which does not list #media-queries as increasing weight.
In my case, my media queries were being added after the initial SCSS and they were still being overridden.
I found out it was because the nesting did not match between the initial styles and the media queries!
I had:
.icon-tray {
// stuff
.icon-tray-icon {
// stuff
div {
// stuff
}
}
}
Then, my media queries had:
// Medium devices (tablets, 768px and up)
#media (min-width: 768px) {
.icon-tray {
// stuff
}
.icon-tray-icon {
// stuff
div {
// stuff
}
}
}
So I changed it to this, and it worked:
#media (min-width: 768px) {
.icon-tray {
// stuff
.icon-tray-icon {
// stuff
div {
// stuff
}
}
}
}
Hope it's clear and helps someone!
css style priority sequence
"!important"
Priority goes to most explicitly define rule.
ex:
1)
.class1 {
.class2 {
.class3 { color: green }
}
}
2)
.class1 {
.class3 { color: red }
}
Priority goes by order (bottom are prior to top)
You must check <head> tag. First, include the main style css file and then include the responsive css file.
something like this :
<link rel="stylesheet" type="text/css" href="mainstyle.css">
<link rel="stylesheet" type="text/css" href="reponsive.css">
Put your responsive css after style css if there is matched issue. Problem will solved.
I had the same issue. I resolved it by placing the media query styles at the end of other styles.

h1 tag positioning on mobile browser

I cant seem to figure out why the h1 tag is showing differently on mobile browsers.
The site is www.jd-financialservices.co.uk When I view the site on my desktop everything is fine. When I view it on my Nexus 4 however, the 10px gap between h1 and the .topbar div has gone. It's the same on Opera, Firefox and Chrome.
Can anyone help please?
Thank you in advance.
I would advise against using position:relative; and negative top on all of your elements.
With some minor changes to your css you will probably find that it fixes itself: here is my updated version of your css. See if that fixes things.
I updated: aside nav h1 .welcome and footer. By changing some of the header elements to use position:absolute and then using margin to space elements out. You will probably find the css is more compatible cross-browser/device.
#font-face { font-family: 'Constantia'; src: url('constantia/constantia.eot'); src: url('constantia/constantia.eot?#iefix') format('embedded-opentype'), url('constantia/constantia.svg#Constantia') format('svg'), url('constantia/constantia.woff') format('woff'), url('constantia/constantia.ttf') format('truetype'); font-weight: normal; font-style: normal;}
* {
margin-top: 0px;
margin-bottom: 0px;
}
html {
font-family: 'droid sans';
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
}
body {
width: 940px;
margin: 0 auto;
}
li {
list-style: none;
}
a {
text-decoration: none;
color: #ffffff;
}
a:hover {
text-decoration: underline;
}
header a:hover {
text-decoration: none;
}
h1 {
font-family: 'Constantia', helvetica;
position: absolute;
top: 20px;
}
header {
height: 140px;
position: relative;
margin-bottom: 40px;
}
nav {
width: 660px;
height: 30px;
background-color: #00788a;
position: absolute;
font-size: 1.2em;
bottom: 0;
right: 0;
}
nav li a {
color: #ffffff;
}
nav a:hover {
text-decoration: underline;
}
nav ul {
padding-left: 0px;
}
nav ul li {
display: inline;
line-height: 30px;
vertical-align: middle;
color: #ffffff;
padding-left: 70px;
padding-right: 65px;
}
aside {
height: 600px;
width: 240px;
float: left;
background-color: #00788a;
color: #ffffff;
clear: both;
position: relative;
text-align: center;
margin-bottom: 30px;
}
article a {
color: #00788a;
}
.contain {
width: 940px;
}
footer {
height: 100px;
clear: both;
background-color: #00788a;
color: rgba(255,255,255,0.5);
position: relative;
font-size: 0.85em;
padding: 0 10px;
line-height: 1.5em;
margin-top: 40px;
}
footer li {
display: inline;
border-left: 2px solid rgba(255,255,255,0.5);
padding: 0 5px;
}
footer li:first-child {
border: none;
}
footer ul {
padding-left: 0;
text-align: center;
}
.foot_fade {
color: rgba(255,255,255,0.5);
}
.first_initial {
font-size: 110px;
color: #00788a;
font-weight: lighter;
}
.second_initial {
font-size: 101px;
color: #00788a;
font-weight: lighter;
position: relative;
top: -6px;
}
.rest_of_title {
font-size: 26px;
position: relative;
left: -73px;
top: 20px;
font-weight: lighter;
}
header a {
color: #000000;
}
.header_background {
float: right;
position: relative;
z-index: -1;
}
.topbar {
width: 940px;
height: 30px;
background-color: #00788a;
}
.call_now {
padding: 10px 50px 10px 50px;
font-size: 1.5em;
line-height: 1.5em;
border-bottom: 5px solid #ffffff;
text-shadow: 2px 2px 2px #2a2a2a;
}
.home_service {
padding: 10px 40px 10px 40px;
font-size: 1.45em;
line-height: 1.5em;
border-bottom: 5px solid #ffffff;
text-shadow: 2px 2px 2px #2a2a2a;
}
.service_list {
font-size: 1.25em;
line-height: 3em;
text-align: left;
padding-top: 35px;
padding-left: 20px;
text-shadow: 2px 2px 2px #2a2a2a;
}
.welcome {
width: 660px;
float: right;
padding: 0px 0px 0px 40px;
font-size: 0.9em;
line-height: 2em;
color: #2a2a2a;
position: relative;
/* top: -95px; */
text-align: justify;
}
.services {
width: 660px;
float: right;
padding: 0px 0px 0px 40px;
position: relative;
top: -95px;
}
.services a {
text-decoration: none;
position: absolute;
top: 151px;
left: 0;
width: 275px;
color: #ffffff;
background-color: rgba(0,0,0,0.5);
padding: 10px 0 10px 10px;
}
.services div {
margin-bottom: 15px;
}
.services div:last-child {
margin-bottom: 0;
}
.savings_pic {
position: relative;
height: 190px;
width: 285px;
}
.retire_pic {
position: absolute;
top: 0;
right: 0;
height: 190px;
width: 285px;
}
.protection_pic {
position: relative;
height: 190px;
width: 285px;
}
.insurance_pic {
position: absolute;
top: 205px;
right: 0;
height: 190px;
width: 285px;
}
.mortgage_pic {
position: relative;
height: 190px;
width: 285px;
}
.retire {
width: 300px;
float: right;
margin: 0 0 10px 10px;
}
/*.shadow {
box-shadow: 0 0 3px 1px rgba(42,42,42,0.5);
margin: 3px 0;
}*/
.overlay {
background-color: rgba(0, 0, 0, 0.5);
bottom: 54px;
color: #FFFFFF;
padding: 10px;
position: relative;
width: 265px;
}
.overlay a {
text-decoration: none;
color: #ffffff;
}
.overlay a:hover {
}
.left {
float: left;
}
.right {
float: right;
}
.regulation {
font-style: italic;
color: #9a9a9a;
font-size: 0.9em;
}
.smallprint {
width: 520px;
font-size: 0.9em;
text-align: center;
position: absolute;
right: 210px;
top: 30px;
}
.copyright {
width: 310px;
margin: 0 auto;
}
.scapa {
position: absolute;
bottom: 0;
right: 10px;
font-size: 0.9em;
}

CSS Navigation Bar Center

<head>
<title>WCK&TMB</title>
<style>
* {
margin: 0px;
padding: 0px;
}
html, body {
width: 100%;
background-color: #FFC18F;
}
div#container {
width: 100%;
min-width: 1024px;
}
header {
height: 100px;
width: 100%;
background-color: #ff8400;
text-align: center;
}
header img {
clear: left;
float: left;
margin: 10px;
}
header a#purchase {
background: url("http://i.imgur.com/RJe8a1D.png") repeat-x;
width: 500px;
height: 25px;
margin: 30px;
padding: 5px;
border: 3px double #ccc;
text-align: center;
float: right;
font-family: Arial;
font-size: 20px;
text-decoration: none;
color: #ffffff;
}
section#main {
padding: 0px 0px 10px 0px;
text-align: center;
}
section#main div#head_announcements {
padding-top: 10px;
color: #000;
font-family: "Arial";
}
section#main div#head_announcements h2 {
font-size: 24px;
font-weight: lighter;
line-height: 26px;
}
section#main h2 a {
color: #FFFFFF;
text-decoration: none;
}
section#main h2 a:hover {
color: #000000;
}
section#main nav {
background: url("./images/navBG.png") repeat-x;
width: 100%;
height: 35px;
text-align: center;
}
section#main nav a.link {
font-family: "Century Gothic";
text-decoration: none;
color: white;
font-size: 25px;
vertical-align: top;
float:center;
}
section#main nav a.link:nth-of-type(1) {
float:center;
}
section#main nav a.link:hover {
color: #39F;
}
section#main nav a.link.active {
color: #39F;
}
section#main section#frames {
margin-top: 10px;
width: 100%;
}
section#main section#frames iframe {
border: 0px;
outline: 0px;
overflow: hidden;
margin: 0px;
padding: 0px;
}
section#main section#frames iframe#frame1 {
width: 650px;
height: 450px;
background-color: black;
}
section#main section#frames iframe#frame2 {
width: 350px;
height: 450px;
}
footer {
padding: 10px 0px 10px 0px;
width: 100%;
text-align: center;
height: 110px;
}
</style>
</head>
URL: http://skyaccess.se/forum/misc.php?page=hdppvs
I can't seem to center the navigation bar text. Can someone please correct this?
Also, I'm trying to learn CSS so if anyone could show me a great site, I'd be very thankful. Considering paying $29/mo are some interaction website with points.
add float:left in your css:
section#main nav {
background: url("./images/navBG.png") repeat-x;
width: 100%;
height: 35px;
text-align: center;
float: left;
also add this css for create gaping between navigation: "padding-right: 40px;".
section#main nav a.link {
font-family: "Century Gothic";
text-decoration: none;
color: white;
font-size: 25px;
vertical-align: top;
float: center;
padding-right: 40px;

jquery datepicker select elements displays different in firefox and ie

After a lot of search and tests, i still can not fix this ui problems.
1. symptom
jQuery plugin datepicker display different in firefox and ie.you could view the pic by clicking FF and IE.
You could see that in ie browser the select month and year displays improperly, background color is different in ff, and in FF the datepicker seems more clearly. I don't know why.
2. css code
The datePicker you could download at http://keith-wood.name/datepick.html. My code is below,html page is:
<style type="text/css">
#import "datePicker/redmond.datepick.css";
</style>
<span id="calendar" class="datepickHideCalendar">
<p>start date</p><p><input type="text" id="popupDatepickerStart"></p>
<p>end date</p><p><input type="text" id="popupDatepickerEnd"></p>
<table align="center"><tr><td><button type="button" id="getDates">run</button></td> </tr></table>
</span>
the redmond.datepick.css is as below:
/* Redmond style sheet for jQuery Datepicker v4.0.5. */
#charset "utf-8";
.datepick {
background-color: #fff;
color: #222;
border: 1px solid #4297d7;
border-radius: 0.25em;
-moz-border-radius: 0.25em;
-webkit-border-radius: 0.25em;
font-family: Arial,Helvetica,Sans-serif;
font-size: 70%;
}
.datepick-rtl {
direction: rtl;
}
.datepick-popup {
z-index: 1000;
}
.datepick-disable {
position: absolute;
z-index: 100;
background-color: white;
opacity: 0.5;
filter: alpha(opacity=50);
}
.datepick a {
color: #222;
text-decoration: none;
}
.datepick a.datepick-disabled {
color: #888;
cursor: auto;
}
.datepick button {
margin: 0.25em;
padding: 0.125em 0em;
background-color: #5c9ccc;
color: #fff;
border: none;
border-radius: 0.25em;
-moz-border-radius: 0.25em;
-webkit-border-radius: 0.25em;
font-weight: bold;
}
.datepick-nav, .datepick-ctrl {
float: left;
width: 100%;
background-color: #fff;
font-size: 90%;
font-weight: bold;
}
.datepick-ctrl {
background-color: #d0e5f5;
}
.datepick-cmd {
width: 30%;
}
.datepick-cmd:hover {
background-color: #dfeffc;
}
button.datepick-cmd:hover {
background-color: #79b7e7;
}
.datepick-cmd-prevJump, .datepick-cmd-nextJump {
width: 8%;
}
a.datepick-cmd {
height: 1.5em;
}
button.datepick-cmd {
text-align: center;
}
.datepick-cmd-prev, .datepick-cmd-prevJump, .datepick-cmd-clear {
float: left;
padding-left: 2%;
}
.datepick-cmd-current, .datepick-cmd-today {
float: left;
width: 35%;
text-align: center;
}
.datepick-cmd-next, .datepick-cmd-nextJump, .datepick-cmd-close {
float: right;
padding-right: 2%;
text-align: right;
}
.datepick-rtl .datepick-cmd-prev, .datepick-rtl .datepick-cmd-prevJump,
.datepick-rtl .datepick-cmd-clear {
float: right;
padding-left: 0%;
padding-right: 2%;
text-align: right;
}
.datepick-rtl .datepick-cmd-current, .datepick-rtl .datepick-cmd-today {
float: right;
}
.datepick-rtl .datepick-cmd-next, .datepick-rtl .datepick-cmd-nextJump,
.datepick-rtl .datepick-cmd-close {
float: left;
padding-left: 2%;
padding-right: 0%;
text-align: left;
}
.datepick-month-nav {
float: left;
text-align: center;
}
.datepick-month-nav div {
float: left;
width: 12.5%;
margin: 1%;
padding: 1%;
}
.datepick-month-nav span {
color: #888;
}
.datepick-month-row {
clear: left;
}
.datepick-month {
float: left;
width: 15em;
border: 1px solid #5c9ccc;
text-align: center;
font-size: 90%;
}
.datepick-month-header, .datepick-month-header select, .datepick-month-header input {
height: 1.7em;
background-color: #5c9ccc;
color: #fff;
font-weight: bold;
}
.datepick-month-header select, .datepick-month-header input {
height: 1.7em;
border: none;
}
.datepick-month-header input {
position: absolute;
display: none;
}
.datepick-month table {
width: 100%;
border-collapse: collapse;
}
.datepick-month thead {
border-bottom: 1px solid #aaa;
}
.datepick-month th, .datepick-month td {
margin: 0em;
padding: 0em;
font-weight: normal;
text-align: center;
}
.datepick-month th {
border: 1px solid #fff;
border-bottom: 1px solid #c5dbec;
}
.datepick-month td {
border: 1px solid #c5dbec;
}
.datepick-month td.datepick-week * {
background-color: #d0e5f5;
color: #222;
border: none;
}
.datepick-month a {
display: block;
width: 100%;
padding: 0.125em 0em;
background-color: #dfeffc;
color: #000;
text-decoration: none;
}
.datepick-month span {
display: block;
width: 100%;
padding: 0.125em 0em;
}
.datepick-month td span {
color: #888;
}
.datepick-month td .datepick-other-month {
background-color: #fff;
}
.datepick-month td .datepick-today {
background-color: #fad42e;
}
.datepick-month td .datepick-highlight {
background-color: #79b7e7;
}
.datepick-month td .datepick-selected {
background-color: #4297d7;
color: #fff;
}
.datepick-status {
clear: both;
text-align: center;
}
.datepick-clear-fix {
clear: both;
}
.datepick-cover {
display: none;
display/**/: block;
position: absolute;
z-index: -1;
filter: mask();
top: -1px;
left: -1px;
width: 100px;
height: 100px;
}
.datepickShowCalendar{visibility:visible}
.datepickHideCalendar{visibility:hidden}
.datePickerTitle{text-align:center;font-size:14px;font-weight:bold}
.datePickerBtn{font-size:12px}
/* CSS Document */
BODY {
background-color:#FAFAFA;
}
#calendar{font-size:12px;text-align:center}
TABLE {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana"
}
TD {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana";
}
P {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana";
color: #003B7F;
}
SELECT {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana"
}
INPUT {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana"
}
TEXTAREA {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana"
}
DIV {
FONT-SIZE: 12px;
FONT-FAMILY: "微软雅黑", "宋体", "Arial", "Verdana"
}
TABLE {
WORD-BREAK: break-all;
BORDER-COLLAPSE: collapse;
text-align: center;
}
UL {
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px;
MARGIN: 0px;
PADDING-TOP: 0px;
LIST-STYLE-TYPE: none
}
LI {
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px;
MARGIN: 0px;
PADDING-TOP: 0px;
LIST-STYLE-TYPE: none
}
FORM {
margin:0px;
LIST-STYLE-TYPE: none
}
FORM {
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px;
MARGIN: 0px;
PADDING-TOP: 0px
}
SELECT {
PADDING-RIGHT: 0px;
PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px;
MARGIN: 0px;
PADDING-TOP: 0px
}
A IMG {
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
BORDER-LEFT: 0px;
BORDER-BOTTOM: 0px
}
A:link {
color:#000066;
TEXT-DECORATION: none
}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: none
}
INPUT {
MARGIN-RIGHT: 5px;
margin-top: 3px;
}
TEXTAREA {
VERTICAL-ALIGN: middle;
MARGIN-RIGHT: 5px
}
SELECT {
VERTICAL-ALIGN:middle;
MARGIN-RIGHT: 5px;
opacity: 1;
}
TEXTAREA {
BORDER: #999999 1px solid;
PADDING-LEFT: 3px;
OVERFLOW: auto;
COLOR: #000;
BACKGROUND-COLOR: #fff
}
.datalist_table{
width:100%;
border:0px;
}
.datalist_table Th {
FONT-WEIGHT: bold;
COLOR: #034579;
HEIGHT: 26px;
text-align:left;
vertical-align:middle;
background:#F0F0F0;
}
.datalist_table TD {
PADDING-RIGHT: 3px;
PADDING-LEFT: 3px;
HEIGHT: 26px;
TEXT-ALIGN: center;
color: #003b7f;
}.datalist_table TD {
PADDING-RIGHT: 3px;
PADDING-LEFT: 3px;
HEIGHT: 26px;
TEXT-ALIGN: center;
color: #003b7f;
}
.list01 {
background:#E4EEF3;
}
.list02 {
background:#D6E4EB
}
i want to know which part of the css is wrong? Why IE displays improperly? Thank you guys.

Resources