Notice how the page is centered in the middle. How can I make it expand to fit the screen, including the columns? Sorry, I'm brand new to coding. I included most of the code because I have no idea where to find it. Hopefully one of you can help. I'm assuming it must be on body or on the home page?
/* Base styles */
*, input[type=search] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
background-color: $color_2;
}
body {
color: $color_4;
font-family: $font_1;
font-size: 13px;
font-weight: lighter;
line-height: 1.5;
margin: 0;
margin-left: 0px;
padding-bottom: 100px;
}
img {
max-width: 100%;
vertical-align: middle;
}
img[width], img[height] {
max-width: none;
}
figure > img {
display: block;
}
a {
color: $color_5;
font-family: $font_2;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
ul, ol {
list-style: none;
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
text-align: left;
width: 100%;
}
[dir="rtl"] table {
text-align: right;
}
td, th {
border-color: #eeeeee;
border-style: solid;
padding: 18px;
}
th {
border-width: 1px 0;
color: #bebebe;
font-size: 11px;
font-weight: normal;
white-space: nowrap;
}
td {
border-width: 0 0 1px 0;
}
h1, h2, h3, h4, h5, h6 {
color: black;
font-weight: 400;
}
h1 {
font-size: 20px;
}
input, label {
display: inline-block;
vertical-align: middle;
}
label {
font-size: 12px;
}
input[type="checkbox"] + label {
margin-left: 5px;
}
input, textarea {
border: 1px solid #dddddd;
border-radius: 2px;
padding: 10px;
}
textarea {
height: 100px;
padding: 7px 10px;
resize: vertical;
}
textarea, input[type=text] {
width: 100%;
}
input, textarea, select {
color: #555;
}
input::-ms-clear {
display: none;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
margin: 0;
-webkit-appearance: none;
}
::-webkit-input-placeholder {
color: #cccccc;
}
:-ms-input-placeholder {
color: #cccccc;
}
::-moz-placeholder {
color: #cccccc;
}
/* Buttons */
button, [role=button], [type=button], [type=submit] {
border-radius: 4px;
border: 1px solid #dddddd;
color: $color_5;
cursor: pointer;
display: inline-block;
padding: 5px 10px;
position: relative;
vertical-align: middle;
white-space: nowrap;
}
a[role=button]:hover {
text-decoration: none;
}
input[type=submit] {
background: #444;
border-color: transparent;
color: #FFF;
padding: 10px 30px;
}
input[type=submit][disabled] {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
/* IE 8 */
opacity: 0.4;
}
button img, [role=button] img {
border-radius: 4px;
margin: 0 5px 0 0;
height: 20px;
position: relative;
top: -1px;
vertical-align: middle;
}
[dir="rtl"] button img, [dir="rtl"] [role=button] img {
margin: 0 0 0 5px;
}
/* Forms */
.form {
max-width: 505px;
}
.form-field + .form-field {
margin-top: 25px;
}
.form-field label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
.form-field input[type=checkbox] + label {
margin: 0 0 0 10px;
}
.form-field.required > label:after {
content: "*";
color: red;
margin-left: 2px;
}
.form-field p {
color: #bebebe;
font-size: 11px;
}
.form-field input[type=number], .form-field input.datepicker {
width: 150px;
}
.form form + form, .searchbox {
margin-top: 25px;
}
.searchbox-suggestions {
background-color: #fff;
border: 1px solid #eeeeee;
border-radius: 4px;
padding: 10px 20px;
}
.searchbox-suggestions li {
padding: 5px 0;
}
[data-loading="true"] input,
[data-loading="true"] textarea {
background: transparent url(/hc/assets/loader.gif) 99% 50% no-repeat;
background-size: 16px 16px;
}
.form footer {
border-top: 1px solid #eeeeee;
margin-top: 40px;
padding-top: 30px;
text-align: right;
}
.form footer a {
color: #cccccc;
cursor: pointer;
margin-right: 15px;
}
/* Navigation menus */
.nav li, .nav-bordered li, .nav-spaced li {
display: inline-block;
font-weight: bold;
}
.nav li a, .nav-bordered li a, .nav-spaced li a {
font-weight: normal;
}
.nav-bordered li + li {
border-color: #eeeeee;
border-style: solid;
border-width: 0 0 0 1px;
margin: 0 0 0 30px;
padding: 0 0 0 30px;
}
[dir="rtl"] .nav-bordered li + li {
border-width: 0 1px 0 0;
margin: 0 30px 0 0;
padding: 0 30px 0 0;
}
.nav-spaced li + li {
margin: 0 0 0 40px;
}
[dir=rtl] .nav-spaced li + li {
margin: 0 40px 0 0;
}
/* Search box */
.search-box, .sub-nav .search {
position: relative;
}
.search-box:before, .sub-nav .search:before {
content: "\1F50D";
font-family: "entypo";
font-size: 1.25em;
line-height: 0;
position: absolute;
text-align: center;
top: 50%;
width: 2.5em;
z-index: 1;
}
.search-box input, .sub-nav .search input {
line-height: 1.2em;
font-weight: lighter;
padding: .75em 2.7em;
width: 100%;
-webkit-appearance: none;
}
.search-box input[type="submit"], .sub-nav .search input[type="submit"] {
display: none;
}
/* Breadcrumbs */
.breadcrumbs li {
color: #bebebe;
display: inline-block;
font-size: 12px;
}
.breadcrumbs li + li:before {
content: ">";
margin: 0 4px;
}
.breadcrumbs li a {
color: $color_4;
}
/* Labels */
.label, .request-status {
border-radius: 20px;
display: inline-block;
font-size: 10px;
padding: 3px 10px;
text-transform: uppercase;
white-space: nowrap;
}
/* Metadata */
.meta, .meta-group {
color: #cccccc;
display: inline-block;
font-size: 11px;
}
.meta-group * + *:before {
content: "\2022";
font-size: 8px;
margin: 0 10px;
}
/* Helper classes */
.clearfix:before, .clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
/* Social share links */
.share {
white-space: nowrap;
}
.share li, .share a {
display: inline-block;
}
.share a {
height: 30px;
line-height: 30px;
overflow: hidden;
vertical-align: middle;
width: 30px;
}
.share a:before {
background: #CCC;
border-radius: 50%;
color: #FFF;
display: inline-block;
font-family: "entypo";
text-align: center;
width: 100%;
}
.share a:hover {
text-decoration: none;
}
.share-twitter:before {
content: "\F309";
}
.share-facebook:before {
content: "\F30C";
}
.share-linkedin:before {
content: "\F318";
}
.share-googleplus:before {
content: "\F30F";
}
/* Pagination */
.pagination {
margin: 20px 0;
text-align: center;
}
.pagination * {
display: inline-block;
}
.pagination li {
border: 1px solid #eeeeee;
float: left;
margin-left: -1px;
}
[dir="rtl"] .pagination li {
float: right;
}
.pagination a, .pagination span {
color: inherit;
font-size: 12px;
padding: 5px 12px;
}
.pagination-current {
background-color: #f9f9f9;
color: #bebebe;
}
.pagination-first {
border-radius: 3px 0 0 3px;
}
[dir="rtl"] .pagination-first {
border-radius: 0 3px 3px 0;
}
.pagination-last {
border-radius: 0 3px 3px 0;
}
[dir="rtl"] .pagination-last {
border-radius: 3px 0 0 3px;
}
/* Markdown styles */
.markdown {
word-wrap: break-word;
line-height: 1.7;
}
.markdown img {
max-width: 70%;
}
.markdown hr {
background-color: #eeeeee;
border: 0;
height: 1px;
}
.markdown ul, .markdown ol {
list-style-position: inside;
padding: 0 15px;
}
.markdown ul {
list-style-type: disc;
}
.markdown ol {
list-style-type: decimal;
}
.markdown pre {
background: #f9f9f9;
border: 1px solid #eeeeee;
border-radius: 3px;
padding: 10px 15px;
overflow: auto;
white-space: pre;
}
.markdown blockquote {
border-left: 1px solid #eeeeee;
color: #bebebe;
font-style: italic;
padding: 0 15px;
}
/* Frame */
main, .header-inner, .footer-inner {
margin: 0 auto;
padding: 20 20px;
width: 500px;
}
/* Columns */
.main-column, .side-column {
display: inline-block;
vertical-align: top;
}
.main-column {
width: 620px;
}
.side-column {
width: 270px;
margin-left: 45px;
}
[dir=rtl] .side-column {
margin-left: 0;
margin-right: 45px;
}
/* Header */
.header {
background: $color_1;
border-bottom: 1px solid #eeeeee;
}
.header-inner {
display: table;
height: 100px;
}
.logo, .user-nav {
display: table-cell;
vertical-align: middle;
}
.logoHD, .user-navHD {
display: table-cell;
position: left;
left: 80px;
vertical-align: middle;
}
.logo img {
max-height: 60px;
}
.logoHD img {
max-height: 60px;
}
.user-nav {
text-align: right;
}
.user-navHD {
left: center;
}
.user-nav > * {
display: inline-block;
margin: 0 0 0 25px;
}
.user-navHD > * {
display: inline-block;
margin: 0 0 0 25px;
}
[dir=rtl] .user-nav {
text-align: left;
}
[dir=rtl] .user-nav > * {
margin: 0 25px 0 0;
}
/* Home page */
.hero-unit {
display: block;
font-size: 22px;
padding: 80px 60px;
}
body.community-enabled .knowledge-base, body.community-enabled .community {
display: inline-block;
vertical-align: top;
}
body.community-enabled .knowledge-base {
width: 620px;
}
.knowledge-base, .community {
display: inline-block;
vertical-align: top;
}
.knowledge-base {
width: 100%;
}
Change
.side-column {
width: 270px;
margin-left: 45px;
}
.main-column {
width: 620px;
}
To
.side-column {
width: 0px;
margin-left: 0px;
}
.main-column {
width: 100%;
}
You have to either use percentages or use something like media queries to set certain widths of the content. An example of percentages would be:
main, .header-inner, .footer-inner {
margin: 0 auto;
width: 90%;
}
You have main set to 500px width. You need to remove that width style. Then main will take up the full width of it's parent container which is the body.
The principle behind this is that a block-level element takes up the full width of it's parent container by default. Since main is a block-level element you don't have to set 100%; it defaults to 100% automatically.
As an aside, your padding style for main is malformed. You have padding: 20 20px; you need to use units, not just numbers. So either write padding: 20px 20px; or even better just padding: 20px;
It looks like you're using fixed sizes in your CSS. For example, the lines below:
.main-column {
width: 620px;
}
.side-column {
width: 270px;
margin-left: 45px;
}
are assigning fixed width values. (By fixed, I mean using units like px, mm, in). Rather, it'd be appropriate to use relative sizes (i.e., percents usually). For larger, containing elements, I tend to use units of vw (viewport width) and vh (viewport height). Doing likewise in your CSS where appropriate should help. Also this makes it easier to optimize for other device sizes should you choose to use CSS media queries later.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want a text box to appear when a user or client is opening my website using IE 11, while I'm trying to resolve a problem in my code.
Or if you maybe have an idea to resolve my problem please write to my inbox here on stackoverflow. (IE 11 is killing me...)
as you can see the problem is when you are opening It on IE it makes the images full size, and the console in ie is not helping that much for me.
Code
Html
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<title>News | Designplace</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="CSS/Navigation.css" rel="stylesheet" type="text/css">
<link href="CSS/Content.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="NavScript.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<div class="sidenav" id="mySidenav">
<!--NAv-->
</div>
<div class="sidenav_small" id="mySidenav_small">
</div>
<div class="sidenav_icon" id="mySidenav_icon">
☰
</div>
<div class="latest">
<h2 class="latest_news">Latest News</h2>
<h4 class="more">More...</h4>
<div class="table">
<div class="tr">
<div class="td">
<a class="img_link" href="/art/news/00004/Review-af-macos-Mojave-public-beta.html">
<img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="macOS">
<div class="inner">
<h3>Review af macOS Mojave beta: God men ikke perfekt.
</h3>
</div>
</a>
</div>
<div class="th"></div>
<div class="td">
<a class="img_link" href="/art/news/00002/206-400-danskere-har-downloadet-ny-nemid-app-i-foerste-doegn-efter-lancering.html">
<img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="NemID">
<div class="inner">
<h3>206.400 danskere har downloadet ny NemID-app i første døgn efter lancering.
</h3>
</div>
</a>
</div>
<div class="th"></div>
<div class="td">
<a class="img_link" href="/art/news/00001/hands-on-nokias-spritnye-foraarskollektion-viser-at-billige-smartphones-ikke-behoever-at-vaere-tarvelige.html">
<img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="Nokia telefon">
<div class="inner">
<h3>Hands-on: Nokias spritnye forårskollektion viser, at billige smartphones ikke behøver at være tarvelige.
</h3>
</div>
</a>
</div>
</div>
</div>
</body>
</head>
</html>
CSS
#charset "UTF-8";
html, body {
height: 100%;
}
.object {
height: 100%;
width: 100%;
}
.table {
display: table;
width: 100%;
}
.tr {
display: table-row;
}
.td {
display: table-cell;
/*border: 1px solid #ccc;*/
padding: 2px;
width: 31.1%
}
#media screen and (max-width: 400px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 40px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
font-size: 14px;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
text-decoration: none;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 401px) and (max-width:600px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
th {
width: 423px;
height: 273px;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 50px;
text-align: center;
margin: -10px;
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
font-size: 18px;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 601px) and (max-width: 720px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
th {
width: 423px;
height: 273px;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 70px;
text-align: center;
margin: -10px;
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
font-size: 24px;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width:720px) and
(max-width:750px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:29%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 750px) and (max-width: 1280px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.th {
width: 20px;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.teaser {
font-size:70%;
min-height: 50%;
padding: 5px 0px 0px 0px
}
.infoline {
font-size: 70%;
color:white;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 1281px) and (max-width: 1440px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:29%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 1441px) and (max-width:1920px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.latest_news {
width: 300px;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
margin-top: 5px;
font-size: 13px;
min-height: 25%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:22%;
margin-right: 20px;
}
.infoline {
font-size: 12px;
}
.article_img {
width: 100%;
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width:1921px) and (max-width:2160px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.latest_news {
width: 300px;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:19.5%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%;
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width:2160px) and (max-width:3840px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.latest_news {
width: 300px;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:11%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%;
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
EDIT:
I changed the code from .Img to .Img_link > Img and that worked but if someone has an idea to get var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; working with an whole javascript, I will be happy, im not that good with javascript yet.
i've tried:
function IncompatibleBrowser() {
var x = document.getElementById("simpleModal")
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if (true) {
x.className += " Incompatible";
} else {
x.className = "Compatible"
}
}
EDIT 2:
Okay the code that Zani gave worked kinda. the console in our browsers only detects the code in IE11, just a I wanted. but the code gave an error:
Script 5007: Unable to get property 'style' of undefined or null reference
This is the code that Zani gave.
<script type="text/javascript">
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if(isIE11)
document.getElementById("IDOfYourElement").style.display="block";
</script>
There is no problem with IE. The problem is in your code.
Please find all .img {width:100%} in your enormous CSS and replace them with
img {width:100%} (without a dot).
You can target IE11 with browser sniffing. This comes with its own downsides, as you might know.
In my experience IE11 is not that bad (compared to IE8 or Safari). So there is a good chance that your issue or set of issues can be handled.
Please ask a more specific question.
<script type="text/javascript">
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if(isIE11)
document.getElementById("IDOfYourElement").style.display="block";
</script>
Please first search before ask question.
Internet Explorer 11 detection
So initially the top half of my black menu blocks appeared over the top of the banner, but now the top half of them are cut off underneath of the banner like this:
Here is my styles.css file:
/* Base */
* {
margin: 0;
padding: 0;
}
body {
/*background-color: #F5F4F1;*/
background-image: url('./img/bg.jpg');
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 20px;
color: #353535;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
#banner {
position: relative;
}
#banner__text-content {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 0;
width: 100%;
text-align: center;
}
#banner__title {
font-size: 5.8rem;
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
}
h1,h2,h3,h4,h5,h6 {
margin: 30px 0;
/*font-weight: 200;*/
color: #8ca757;
}
h1 {
font-size: 35px;
}
h1 small {
font-size: 25px;
color: #666;
}
h2 + p {
margin-top: -20px;
}
h3 + p {
margin-top: -20px;
}
h2,h3,h4 {
font-size: 30px;
}
h4.error {
color: #faa722;
}
h5,h6 {
font-size: 20px;
}
p {
margin: 0 0 20px;
}
a:link, a:visited {
color: #8ca757;
}
a:hover {
color: #7a9347;
}
ul, ol {
margin: 0 0 10px 18px;
}
ul li, ol li {
margin: 0 0 15px;
}
hr {
border: none;
height: 18px;
width: 114px;
background-image: url('./img/hr.png') center center no-repeat;
margin: 20px auto;
}
small {
font-size: 12px;
}
blockquote {
background: white;
padding: 10px;
margin: 0 0 15px;
border-left: solid 4px #d1cbb8;
font-style: italic;
}
blockquote p {
margin: 5px 0 10px;
}
blockquote code {
font-style: normal;
}
code {
color: #006699;
font-weight: bold;
font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
}
sup {
font-size: 0.6em;
}
/* Layout */
.wrapper {
position: relative;
width: 620px;
margin: 40px auto;
padding: 40px;
background: white;
text-align: center;
}
.wrapper:before, .wrapper:after {
content: "";
position: absolute;
top: 5px;
left: -5px;
width: 100%;
height: 100%;
background: #97917e;
z-index: -1;
}
.wrapper:before {
top: 10px;
left: -10px;
background: #514933;
}
#logo {
width: 240px;
margin: 0 auto;
display: block;
}
.sandbox {
padding: 20px;
background: #f8f5f1;
text-align: left;
}
aside {
background: white;
border: dashed 2px #97917e;
padding: 10px 20px;
margin: 40px;
}
aside h3 {
font-size: 24px;
margin-top: 10px;
}
aside h6 {
margin: 15px 0 5px;
}
table {
width: 100%;
font-size: 13px;
background: white;
margin: 0 0 20px;
}
table td {
border-bottom: solid 1px #d1cbb8;
padding: 4px;
}
table th {
background: #8ca757;
color: white;
padding: 4px;
font-weight: normal;
font-size: 15px;
}
/* Global */
input {
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
autton, input.button {
display: inline-block;
background: #ccc;
outline: solid 2px #ccc;
border: solid 2px white;
color: white;
padding: 10px 15px;
margin: 20px 0;
text-decoration: none;
font-family: inherit;
font-size: inherit;
font-weight: bold;
cursor: pointer;
}
.button:hover, input.button:hover {
background: #bbb;
outline-color: #bbb;
}
.button.prev {
float: left;
background: #514933;
outline-color: #514933;
}
.button.prev:hover {
background: #494331;
outline-color: #494331;
}
.button.next, input.button.next {
background: #8ca757;
outline: solid 2px #8ca757;
float: right;
}
.button.next:hover, input.button.next:hover {
background: #7c9745;
}
input.button.next {
display: block;
float: none;
width: 100%;
}
.block {
display: block;
}
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.cf {
*zoom: 1;
}
.copyright-info h4, .copyright-info h5 {
margin: 0;
line-height: 18px;
font-size: 14px;
text-align: center;
}
.copyright-info h4 {
font-weight: bold;
}
.copyright-info {
margin: 20px 0 40px;
}
/* Final example website */
#final-example .wrapper {
width: 800px;
padding: 0;
}
#final-example .content {
padding: 20px 50px 50px;
text-align: left;
}
#final-example #nav {
margin: -27px 0 0;
}
#final-example #nav ul {
display: inline-block;
list-style: none;
text-align: left;
}
#final-example #nav ul li {
display: inline-block;
text-align: center;
margin: 0 10px;
}
#final-example #nav ul li a {
display: block;
background: #353535;
outline: solid 2px #353535;
border: solid 2px white;
color: white;
padding: 10px 15px;
text-decoration: none;
}
#final-example #nav ul li a:hover {
background: #8ca757;
outline: solid 2px #8ca757;
}
#final-example #philosophy {
text-align: center;
font-size: 18px;
line-height: 22px;
}
#final-example #footer {
font-size: 12px;
line-height: 15px;
margin: 60px 0 0 0;
}
#final-example #footer strong {
display: block;
margin: 0 0 20px;
}
#final-example .column {
display: block;
float: left;
}
#final-example .column.three {
width: 203px;
margin-right: 45px;
}
#final-example .column.last {
margin: 0;
}
#final-example small {
display: block;
text-align: center;
margin: 40px 0 0;
}
#final-example .member {
width: 203px;
float: left;
margin-right: 45px;
}
#final-example .member:last-child {
margin: 0;
}
#final-example .member img {
max-width: 100%;
}
#final-example .closed {
color: #d13916;
}
#final-example .open {
color: #67b512;
}
#menu-items ul {
list-style: none;
margin: 0;
padding: 20px 0;
text-align: center;
font-size: 18px;
}
#menu-items ul li a {
text-decoration: none;
font-weight: bold;
}
.price {
float: right;
font-size: 18px;
font-weight: bold;
color: #353535;
}
#contact {
width: 320px;
margin: 0 auto;
}
#contact-form label {
display: block;
font-size: 11px;
font-weight: bold;
text-transform: uppercase;
}
#contact-form input[type="text"],
#contact-form input[type="email"],
#contact-form textarea {
border: solid 2px #353535;
outline: none;
font-size: 18px;
padding: 10px;
margin: 0 0 10px;
width: 300px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
}
#contact-form textarea {
resize: vertical;
height: 120px;
}
#contact-form input[type="checkbox"] + label {
display: inline;
cursor: pointer;
}
When I try to do this:
#final-example #nav {
margin: -27px 0 0;
position: absolute;
}
to this
#final-example #nav {
margin: -27px 0 0;
}
this happens:
and text-align:center; did not work. Any ideas?
Here is the index.php:
<!DOCTYPE html>
<html>
<head>
<title>MicroUrb</title>
<link rel="stylesheet" href="assets/styles.css">
</head>
<body id="final-example">
<div class="wrapper">
<div id="banner">
<a href="/" title="Return to Home">
<img src="assets/img/banner0.jpg" alt="MicroUrb">
<div id="banner__text-content">
<h1 id="banner__title">MicroUrb</h1>
</div>
</a>
</div><!-- banner -->
<div id="nav">
<ul>
<li>Home</li>
<li>Team</li>
<li>Products</li>
<li>Contact</li>
</ul>
</div><!-- nav -->
<div class="content">
<div id="footer" class="cf">
<div class="column three">
<strong>Phone</strong>
609.505.3395
</div><!-- column -->
<div class="column three">
<strong>Location</strong>
<!-- location to go here -->
</div><!-- column -->
<div class="column three last">
<strong>Hours</strong>
<em>Tuesday - Thursday</em><br>
1:00pm - 9:00pm<br><br>
<em>Friday and Saturday</em><br>
4:00pm - 11:00pm<br><br>
<em>Sunday - Monday</em>
Closed<br><br>
</div><!-- column -->
</div><!-- footer -->
<small>©2017 MicroUrb</small>
</div><!-- content -->
</div><!-- wrapper -->
<div class="copyright-info">
<?php includes('../assets/includes/copyright.php'); ?>
</div><!-- copyright-info -->
</body>
</html>
Put a z-index on the nav and set the position to relative
#final-example #nav {
margin: -27px 0 0;
z-index: 5;
position: relative;
}
I believe to get the navigation in front of the banner like you are trying to achieve you could utilise the z-index property.
Add a z-index of 1 to your #final-example #nav {} and a z-index of 0 to your #banner {} which will bring the navigation in front of the banner while keeping its absolute positioning in the centre.
The final outcome will be:
#final-example #nav {
margin: -27px 0 0;
position: absolute;
z-index: 1;
}
#banner {
position: relative;
z-index: 0;
}
Let me know if you need any other help.
You can use z-index on the nav element to make it appear above the banner if you set the banner to a lower z-index compared to the nav element.
So for example:
#final-example #nav {
z-index:1;
position:relative;
margin:-27px auto 0;
}
That said, it would be useful if you would've posted your html part as well.
Edit:
Further investigation and with a temporary asset, the code seems to work fine with the code posted above as can be seen in this JSFiddle: https://jsfiddle.net/t2d70q3y/2/
Let me know if you require further assistance.
hi i am having provlems with my drop down menu on my index page, the drop down items are hidden below my image slider which is directly below my nav bar, i would like to be able to see the drop down menu items, any help would be greatly appreciated
thank you very much;
here is my html for the nav bar:
<div class="nav">
<ul>
<li class="home">Home</li>
<li class="">sports news
<ul>
<li>headlines</li>
<li>when an where</li>
<li>rewind</li>
<li>manager of the week </li>
</ul>
</li>
<li class="about"><a class="active" href="#">music</a></li>
<li class="news">events
<ul>
<li>News #1</li>
<li>News #2###</li>
<li>News #3</li>
</ul>
</li>
<li class="contact">events</li>
<li class="contact">gallery</li>
<li class="contact">Contact</li>
</ul>
</div>
<div class="cleaner"></div>
and here is my css:
/*
jmc
*/
body {
margin: 0px;
padding: 0px;
color: #4d4638;
font-family: Tahoma, Geneva, sans-serif;
font-size: 13px;
line-height: 1.7em;
background: url(images/tooplate_body.jpg);
background-color: #c2b8a1;
background-repeat: repeat-x;
background-position: top
}
a, a:link, a:visited { color: #000; font-weight: bold; text-decoration: none; }
a:hover { text-decoration: underline; }
.orange {
color: #FC0;
}
.green {
color: #CF6;
}
p { margin: 0 0 10px 0; padding: 0; }
img { border: none; }
em { color: #000; font-weight: bold; font-style: normal }
h1, h2, h3, h4, h5, h6 { color: #000; font-weight: normal; }
h1 { font-size: 34px; margin: 0 0 20px 0; padding: 5px 0 }
h2 { font-size: 28px; margin: 0 0 20px 0; padding: 5px 0; }
h3 { font-size: 24px; margin: 0 0 15px; padding: 0; }
h4 { font-size: 18px; margin: 0 0 15px; padding: 0; }
h5 { font-size: 16px; margin: 0 0 10px; padding: 0; }
h6 { font-size: 14px; margin: 0 0 5px; padding: 0; }
.cleaner { clear: both }
.h10 { height: 10px }
.h20 { height: 20px }
.h30 { height: 30px }
.h40 { height: 40px }
.h50 { height: 50px }
.h60 { height: 60px }
a.more {
clear: both;
display: block;
width: 87px;
height: 31px;
padding-right: 15px;
line-height: 30px;
text-align: center;
color: #000;
font-weight: bold;
background: url(images/tooplate_btn.png);
}
a.more:hover {
text-decoration: none;
color: #960;
}
.float_l { float: left }
.float_r { float: right }
.tooplate_margin { margin: 10px; }
.image_wrapper {
display: inline-block;
border: 1px solid #cac2b1;
background: #b5ac98;
padding: 4px;
margin-bottom: 5px;
}
.image_fl {
float: left;
margin: 3px 15px 0 0;
}
.image_fr {
float: right;
margin: 3px 0 0 15px;
}
.tooplate_list {
margin: 20px 0 20px 20px;
padding: 0;
list-style: none;
}
.tooplate_list li {
color:#000;
margin: 0 0 5px 0;
padding: 0 0 0 25px;
background: url(images/tooplate_list.png) no-repeat scroll 0 5px;
}
.tooplate_list li a {
color: #000;
font-weight: normal;
}
.tooplate_list li a:hover {
text-decoration: underline;
}
#tooplate_header {
width: 960px;
padding: 10px 0;
margin: 0 auto;
}
#site_title {
float: left;
}
#site_title h1 {
margin: 30px 0 0 0;
padding: 0;
}
#site_title h1 a {
display: block;
width: 278px;
height: 50px;
color: #fff;
text-indent: -10000px;
background: url(images/tooplate_logo.png) no-repeat;
}
/* menu */
#tooplate_menu {
float: right;
width: 632px;
height: 48px;
margin-top: 40px;
background: url(images/tooplate_menu.png)
}
#tooplate_menu ul {
width: 600px;
margin: 0 auto;
padding: 0;
list-style: none;
}
#tooplate_menu ul li {
float: left;
display: block;
padding: 0;
margin: 0;
display: inline;
text-align: center;
}
#tooplate_menu ul li a {
display: block;
width: 116px;
padding: 9px 4px 9px 0;
margin: 0;
font-size: 14px;
text-align: center;
text-decoration: none;
color: #000000;
text-shadow: 1px 1px 1px #cec8ba;
font-weight: normal;
outline: none;
border: none;
background: url(images/tooplate_menu_divider.png) center right no-repeat
}
#tooplate_menu ul li a:hover, #tooplate_menu ul li .current {
color: #fff;
text-shadow: 1px 1px 1px #3d3728;
}
#tooplate_menu ul .last {
background: none;
}
#search_box {
float: right;
margin: 12px 0 0 0;
width: 170px;
height: 27px;
background: url(images/tooplate_search.png) no-repeat;
}
#search_box form {
clear: both;
width: 170px;
height: 26px;
padding: 0;
margin: 0;
}
#searchfield {
float: left;
display: block;
height: 16px;
width: 130px;
padding: 5px;
font-size: 12px;
color: #ccc;
line-height: 0;
background: none;
border: none;
}
#searchbutton {
float: right;
display: block;
height: 26px;
width: 30px;
padding: 0;
margin: 0;
cursor: pointer;
background: none;
border: none;
}
/* end of menu */
/* slider */
#tooplate_middle {
clear: both;
width: 940px;
height: 307px;
padding: 10px 40px;
margin: 0 auto;
background: url(images/tooplate_middle_home.png) no-repeat
}
#tooplate_middle_subpage {
clear: both;
width: 820px;
height: 207px;
padding: 60px 100px;
margin: 0 auto;
font-family: Georgia, "Times New Roman", Times, serif;
background: url(images/tooplate_middle_subpage.png) no-repeat;
}
#tooplate_middle_subpage h2 {
font-size: 48px;
color: #000;
}
#tooplate_middle_subpage p {
font-size: 18px;
color: #000;
line-height: 30px;
}
#tooplate_middle_subpage a {
color: #507921;
font-weight: normal;
}
#slider {
float: right;
width: 940px;
height: 300px;
overflow: hidden;
}
/* end of slider */
#tooplate_main {
clear: both;
width: 960px;
padding: 30px 0;
margin: 0 auto;
}
.col_w960 { width: 960px; margin-bottom: 40px }
.col_w600 { width: 600px }
.col_w450 { width: 450px }
.col_w300 { width: 300px }
.col_allw300 { width: 300px; float: left; margin-right: 30px }
.col_last { margin: 0 }
.col_w960_last { margin: 0; background: none; }
.col_last { margin: 0; }
.wwd_box { clear: both; margin-top: 20px; margin-bottom: 40px }
.wwd_box img { float: left; width: 80px; margin-right: 30px }
.wwd_box h3 { font-size: 16px; margin-bottom: 0 }
.wwd_box h3 a { color: #507921; font-size: 16px; font-weight: normal }
.wwd_box p { margin-bottom: 30px; }
.lp_box { float: left; width: 300px; margin-right: 30px }
.lp_box h6 { font-weight: bold; color: #507921 }
.lp_box_last { margin: 0 }
.lp_box img { border: 1px solid #CCC; padding: 4px }
#cp_contact_form {
margin: 10px;
padding: 0;
width: 412px;
}
#cp_contact_form form {
margin: 0px;
padding: 0px;
}
#cp_contact_form form .input_field {
width: 400px;
padding: 10px;
border: 1px solid #ccc;
background: #fff;
color: #333;
font-family: Verdana,Geneva,sans-serif;
font-size: 12px;
margin-top: 5px;
}
#cp_contact_form form label {
display: block;
width: 100px;
margin-right: 10px;
font-size: 14px;
}
#cp_contact_form form textarea {
width: 400px;
height: 160px;
padding: 10px;
border: 1px solid #ccc;
background: #fff;
color: #333;
font-family: Verdana,Geneva,sans-serif;
font-size: 12px;
margin-top: 5px;
}
#cp_contact_form form .submit_btn {
margin: 5px 0px;
padding: 5px 14px;
text-decoration: none;
border: 1px solid #ccc;
background: #fff;
font-size: 14px;
}
#map {
margin: 10px;
}
#map img {
width: 300px;
height: 200px;
border: 1px solid #d9d3c5;
background: #b5ac98;
padding: 7px;
margin-bottom: 10px;
}
.news_box {
clear: both;
margin-bottom: 30px;
padding-bottom: 30px;
border-bottom: 1px dashed #333;
}
.news_box h2 {
font-size: 20px;
margin-bottom: 0;
}
.news_box p.date {
color: #000;
}
.news_box img {
float: left;
padding: 4px;
border: 1px solid #000;
margin-right: 30px;
}
.news_box a.more {
clear:none;
float: right;
}
.sb_lp_box {
clear: both;
margin-bottom: 20px;
}
.sb_lp_box img {
border: 1px solid #cac2b1;
background: #b5ac98;
padding: 8px;
margin-bottom: 10px;
}
.post_box {
clear: both;
margin-bottom: 30px;
}
.post_box h2 {
font-size: 20px;
margin-bottom: 10px;
}
.post_box p.post_meta {
margin-bottom: 0;
}
.post_box p span.cat a {
color: #507921;
font-weight: 400;
}
.post_box img {
width: 550px;
height: 160px;
border: 1px solid #cac2b1;
background: #b5ac98;
padding: 8px;
margin-bottom: 10px;
}
.post_box a.more {
float: left;
}
.lbe_box {
clear: both;
margin-bottom: 20px;
}
.lbe_box h3 {
font-size: 16px;
margin-bottom: 0;
}
.lbe_box h3 a {
color: #507921;
font-size: 16px;
font-weight: normal;
}
.lbe_box h3 a span {
font-size: 12px;
color: #507921;
}
.lbe_box p {
margin-bottom: 0;
}
.lbe_box p.date {
font-size: 10px;
font-weight: 700;
color: #507921;
}
#gallery {
margin: 0;
padding: 0;
}
#gallery ul {
margin: 0;
padding: 0;
}
#gallery ul li {
display: block;
float: left;
width: 281px;
margin: 0 30px 30px 0;
padding: 8px;
border: 1px solid #d0c9b8;
background: #b6ac97;
}
#gallery ul .third {
margin: 0 0 30px 0;
}
#gallery ul li a img {
border: 1px solid #ccc;
margin-bottom: 5px;
}
#tooplate_footer_wrapper {
clear: both;
width: 100%;
background: #a19882;
border-top: 10px solid #d0c8b4;
}
#tooplate_footer {
width: 960px;
margin: 0 auto;
padding: 15px 0;
text-align: center;
color: #000;
background: url(images/tooplate_footer.jpg) top center no-repeat
}
#tooplate_cr a {
color: #5fa008;
font-weight: normal;
}
.nav ul {
list-style: none;
background-color: #444;
text-align: center;
padding: 0;
margin: 0;
}
.nav li {
font-family: 'Oswald', sans-serif;
font-size: 1.2em;
line-height: 40px;
text-align: left;
}
.nav a {
text-decoration: none;
color: #fff;
display: block;
padding-left: 15px;
border-bottom: 1px solid #888;
transition: .3s background-color;
}
.nav a:hover {
background-color: #005f5f;
}
.nav a.active {
background-color: #aaa;
color: #444;
cursor: default;
}
/* Sub Menus */
.nav li li {
font-size: .8em;
}
/*******************************************
Style menu for larger screens
Using 650px (130px each * 5 items), but ems
or other values could be used depending on other factors
********************************************/
#media screen and (min-width: 650px) {
.nav li {
width: 130px;
border-bottom: none;
height: 50px;
line-height: 50px;
font-size: 1.4em;
display: inline-block;
margin-right: -4px;
}
.nav a {
border-bottom: none;
}
.nav > ul > li {
text-align: center;
}
.nav > ul > li > a {
padding-left: 0;
}
/* Sub Menus */
.nav li ul {
position: absolute;
display: none;
width: inherit;
}
.nav li:hover ul {
display: block;
}
.nav li ul li {
display: block;
}
}
#nav ul {
z-index: 9999;
}
thanks again;
From what I can see from the snippet provided, my best guess would be to add:
position:relative;
to your:
#nav ul{
z-index:9999;
}
HOWEVER I cannot see div id="nav" in your html! If you have just not included it in your snippet, that's fine, but if this is also an error and you mean to assign that css to div class="nav", then try changing that whole block to:
.nav ul{
position:relative;
z-index:9999;
}
One final note to remember, assign z-index to elements that ALSO have a position set (be it relative or absolute etc) - as far as i'm aware, z-index doesn't work unless the block has a position attribute set to it also.
Hope this works for you.
So I am developing a little forum and I ran into a little design problem. The sidebar in each post is supposed to match the height of the content (the text written) but the sidebar only goes to the height necessary to display everything and then stops.
JSFiddle: http://jsfiddle.net/9stPU/5/
CSS:
.forumContent {
list-style-type: none;
background: #34495e;
letter-spacing: 1px;
width: 1170px;
margin: 0;
color: white;
}
.forumContent li {
padding: 0 0 0 10px; /* 5px 0 5px 10px */
margin-left: -40px;
min-height: 41px;
overflow: auto;
border-bottom: 1px solid #000;
}
.forumContent li:last-child {
border-bottom: none;
}
.forumContent li h3 {
margin: 0;
padding: 0;
font-size: 14px;
}
.forumContent li small {
font-size: 9px;
}
.forumContent a {
color: white;
text-decoration: none;
width: 100%;
height: 100%;
}
.forumContent li:hover {
background: #3E5368;
}
.forumContent a li {
float: left;
width: 366px;
}
.forumContent a li:first-child {
width: 100px;
}
.forumContent li .new b {
font-size: 12px;
}
.forumContent li .new {
float: right;
margin-right: 8px;
margin-top: -2px;
font-size: 9px;
background: #2c3e50;
padding: 4px;
border-radius: 6px;
}
.topicUser {
width: 150px;
float: left;
background: #000;
margin-left: -10px;
min-height: 100%;
height: 100%;
}
.topicUser h3 {
margin-left: 2 .5px !important;
}
.topicUser small {
position: absolute;
margin-top: -15px;
margin-left: 7 .5px;
}
.topicUser p {
margin-top: 2px;
margin-left: 3px;
}
.topicContent {
width: 1060px;
float: right;
height: 100%;
}
.topicContent p {
padding: 5px;
}
You can use display:table; properties: DEMO
a single patch to test it ;
li {
display:table;
}
li > div {
display:table-cell;
float:none!important;/* float kills display; so do not use it with display; */
vertical-align:top;
}
Put:
.forumContent li {
padding: 0 0 0 10px; /* 5px 0 5px 10px */
margin-left: -40px;
min-height: 41px;
overflow: auto;
border-bottom: 1px solid #000;
position: relative;
}
and
.topicUser {
width: 150px;
float: left;
background: #000;
margin-left: -10px;
min-height: 100%;
height: 100%;
position:absolute;
}
notice position properties.
Look here http://jsfiddle.net/9stPU/6/
I am using a joomla template with a built-in dropdown menu wich doesn't have many options.
This is how i want my menu to look like:
http://i.stack.imgur.com/GMdIc.png
I tried many tricks like making 2-3 or 4 columns but if a "continent" has less countries to be shown then the next item appears in the same continent. How do i make it to be like a table from the 1st image? Thanks
This is the css code in my menu: http://jsfiddle.net/AUCGy/
.gf-menu {
// Menu positioning margin: 0px auto 0;
list-style: none;
// Clears &:after {
display: table;
content:'';
clear: both;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
hover {
background:#000;
}
// Basic font stuff .item {
font-size: #menuFontSize;
line-height: #menuLineHeight;
color: #000000;
padding: 10px 15px;
text-align: left;
text-shadow: 1px 1px 0 #menuTextShadow;
text-decoration: none;
display: block;
outline1: 0;
cursor: pointer;
.transition(background 0.2s ease-out, border 0.2s ease-out);
// Subtext styling &.subtext {
> em {
bottom: -42px;
height: 42px;
font-size: #menuFontSize + 2;
color: #000000;
font-style: normal;
}
}
// Menu icon tweaks &.icon {
[class^="icon-"], [class*=" icon-"] {
background-image: none !important;
width: auto;
&:before {
text-indent: 0;
margin-right: 5px;
}
}
}
// Menu Image tweaks .menu-image {
max-width: inherit;
vertical-align: text-top;
margin-top: 0px;
margin-left: -2px;
}
}
// Level 1 Style Overrides &.l1 {
> li.active {
}
> li > .item {
font-size: #menuFontSize + 3;
line-height: #menuLineHeight + 2;
padding-top: 30px;
padding-bottom: 30px;
padding-left: 1px;
padding-right: 1px;
position: relative;
&.subtext {
padding-top:1px;
padding-bottom: 4px;
}
.menu-image {
margin-top: -1px;
}
}
}
// Default items li {
float: left;
display: block;
text-align: center;
position: relative;
padding: 0;
border: none;
border: none;
margin-right: 10px;
}
// Parent items li.parent {
> .item {
position: relative;
&:after {
color: #menuArrowColor;
position: absolute;
right: 6px;
top: 50%;
margin-top: -12px;
font-family: FontAwesome;
// content:"\f0d7";
// icon-caret-down content: none;
// icon-chevron-down font-size: 25px;
}
}
}
// Dropdown styling .dropdown {
margin: 0 auto;
margin-left: 1px;
padding: 0px 0;
position: absolute;
opacity: 0;
left: -999em;
text-align: left;
border: none;
background: #FAEFAA;
.transition(opacity 0.2s ease-out);
.border-radius(0 !important);
.box-shadow(#menuFullShadow);
z-index: 1000;
.flyout {
display: block;
}
ul {
li {
display:block;
float:none;
font-size: 20px;
margin-right: 0;
padding: 0 0px;
border: 0;
border-bottom: 1px solid #menuDropdownborderbottom;
&.active {
> .item {
color: #menuTextHover;
background:#fff url(templates/insightfx/images/icons/afri.png) no-repeat 0 -20px;
}
}
.item {
color: #000000 !important;
text-shadow1: 1px 1px 0 #menuTextShadow1 !important;
font-size: 12px;
}
&.parent {
> .item:after {
margin-top: -10px;
font-family: FontAwesome;
// content:"\f0da";
// icon-caret-right content:"\f054";
// icon-chevron-right font-size: 25px;
}
}
}
}
// Grouped styling .grouped {
&.parent {
> .item {
.border-fixer {
display:none;
}
&:after {
font-family: FontAwesome;
// content:"\f0d7";
// icon-caret-down content:"\f078";
// icon-chevron-down font-size: 11px;
}
}
}
ol {
background: #menuActiveBack;
border: 1px solid #menuActiveBorder;
.box-shadow(#menuActiveShadow);
margin: 0px 0px;
padding: 0px 0;
> li {
> .item {
font-size: #menuFontSize - 1;
padding-top: 3px;
padding-bottom: 3px;
}
}
}
}
// Module styling .modules {
text-align: left;
color: #moduleTextColor;
.module-content {
padding: 5px 10px;
h1, h2, h3, h4, h5 {
color: #moduleHeaderColor;
}
a {
color: #moduleLinkColor;
}
p {
margin: 0 0 10px 0;
font-size: #menuFontSize - 1;
line-height: #menuLineHeight - 3;
}
}
}
}
// Flyout Dropdown (3rd Level +) .flyout {
border-top: 1px solid #menuBorder;
}
// Columns .column {
float: left;
position: relative;
}
// Alignment Helpers .position-left {
float: left;
margin-right: 15px;
}
.position-right {
float: right;
margin-left: 15px;
}
// Splitmenu specific fixes &.gf-splitmenu {
li.parent {
&:hover {
.border-radius(#menuItemRadius);
}
}
}
}
Firstly you want to work in rows instead of columns as then you won't need to worry about that
Here is the css I would use:
.row-item {
display: block;
float: left;
padding: 5px;
border-left: solid 1px black;
border-right: solid 1px black;
}
.row {
position: relative;
display: block;
float: left;
clear: left;
}
.continent {
background: maroon;
color: wheat;
}
.country {
background: wheat;
color: maroon;
}
HTML:
<div class='row'>
<div class='continent row-item'>
Continent
</div>
<div class='row-item country'>
Country
</div>
</div>
<div class='row'>
<div class='continent row-item'>
Continent
</div>
<div class='row-item country'>
Country
</div>
</div>
Here is a fiddle demo
http://jsfiddle.net/Hive7/vMu8e/