Anyone who know how I write the css to get the background to be under left menu and than go out to the left; full width.
Back in the old days you could do this with frameset, but how about nowadays?
.currentpage-category {
main {
padding: 0;
}
#categoryWithSidemenu{
background: rgb(31,57,87);
background: linear-gradient(163deg, rgba(31,57,87,1) 0%, rgba(94,106,120,1) 100%);
background-size: 30% 100%;
background-repeat: no-repeat;
width: 100vw;
margin-left: calc((100% - 100vw) / 2);
.categoryContainer {
width: 100%;
padding: 20px 0 200px 0;
margin-right: auto;
margin-left: auto;
max-width: 1426px;
}
}
#categoryWithoutSidemenu {
padding: 100px 15px 120px;
}
}
This is what I have tried, but the "background-size" above doesn't work.
Thank for reply, but I found a solution by my self.
https://imgur.com/kWnl089
.currentpage-category {
main {
padding: 0;
}
#categoryWithSidemenu > * {
margin: 0;
}
#categoryWithSidemenu{
background-color: #1d2e42;
width: 100vw;
margin-left: calc((100% - 100vw) / 2);
.categoryContainer {
width: 100%;
padding: 0px 0 0px 0;
max-width: 1426px;
margin: 0 auto;
position: relative;
z-index: 2;
&:after {
content: " ";
display: block;
clear: both;
}
.sidebar {
width: 200px;
float: left;
min-height: 600px;
}
.side-content {
background: #1d2e42;
padding: 20px 20px 100px;
}
}
&:before {
content: " ";
z-index: 1;
display: block;
position: absolute;
left: 0;
top: 650px;
background: rgb(31,57,87);
background: linear-gradient(180deg, rgba(31,57,87,1) 0%, rgba(94,106,120,1) 100%);
width: 50%;
height: 100%;
}
}
Related
How would I get it to work with added borders?
Left side is 21px right side is 14px.
What would I need to adjust in the code?
.tcell {
display: table-cell;
vertical-align: middle;
padding: 0 20px;
}
Code
https://jsfiddle.net/udsav90r/2/
Full Code:
html,
body {
height: 100%;
background: #000000;
padding: 0;
margin: 0;
}
.outer {
display: table;
height: 100%;
margin: 0 auto;
width: 100%;
}
.tcell {
display: table-cell;
vertical-align: middle;
padding: 0 20px;
}
.video-wrapper {
min-width: 40%;
max-width: 789px;
margin: auto;
}
.ratio-keeper {
position: relative;
padding-top: 56.25%;
}
.video-frame {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.video {
border-radius: 25px;
border: 3px solid green;
}
I have a demo here - https://codepen.io/mt-ttmt/pen/mLMGvr
I have a horizontally scrolling content div
I need to have a margin either side of this scrolling content.
I have done this using calc.
When page scrolls the scrolling content sticks to the top of the page using position: fixed;
When this happens I lose the margins.
How can I keep the margins with position: fixed;
html, body{
height: 100%;
}
body {
background: grey;
font-family: sans-serif;
margin: 0;
}
.upper-content{
background: red;
height: 250px;
}
.page-content{
position: relative;
background: white;
height: 2000px;
max-width: 900px;
margin: 0 auto;
}
.content-wrapper{
position: relative;
}
.header-scroll{
border: 1px solid yellow;
left: 50%;
overflow-y: scroll;
position: absolute;
max-width: 900px;
z-index: 20;
transform: translateX(-50%);
width: -webkit-calc(100% - 50px);
}
.content{
display: flex;
float: left;
div{
background: lightgrey;
font-size: 20px;
padding: 40px;
margin-right: 5px;
width: 100%;
&:last-of-type{
margin-right: none;
}
}
}
.fixed{
position: fixed;
top: 0;
//margin: 0 25px 0 25px;
//width: calc(100% - 50px);
}
Change your .fixed class width value.
.fixed{
width: calc(900px - 50px);
}
Okay, so at this moment I am busy learning responsive CSS. It might be simple for you, but I don't understand how to archieve this:
I am playing with making a 'grid'. I have set all the classes to percentages in width and height, so that should not be the problem. However, when I resize the viewport (window), it's not dynamically growing or shrinking.
See: here
Currently using the following html:
<meta name="viewport" content="width=device-width" />
<div id="wrapper">
<div id="header">
</div>
<div id="presenter">
</div>
<div id="main">
</div>
Using the following CSS:
<style>
/* Theme */
html {
margin-top: 0px !important;
}
/* DO NOT EDIT OR MONKEYS WILL BITE YOU */
.frame_holder {
position: absolute;
top: 8px;
bottom: 50px;
/* left: 50px; */
right: 150px;
background: #ffffff;
}
.my_frame {
width: 149%;
height: 108%;
/* border: 1px solid #e0e0e0; */
}
body {
background-color: #f0ede9;
margin-top: 0px;
position: relative;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.clearfix {
clear: both;
}
p {
font-family: Roboto;
padding: 1px;
}
#body.layout-1 {
background: #f0ede9 url(../images/border.gif) 640px top repeat-y scroll;
background-color: #f0ede9;
background-image: url(../images/border.gif), url(../images/border-2.gif);
background-repeat: repeat-y, repeat-y;
background-position: 640px top, 0px top;
}
a:hover, a:visited, a:link, a:active {
text-decoration: none;
color: #bababa;
font-family: Roboto;
}
#wrapper {
width: 965px;
margin: 0 auto;
overflow: hidden;
}
#header {
width: 100%;
height: 80px;
background: #2a2727;
margin-top: 20px;
color: #fff;
}
.top-logo-container {
display: block;
height: 100px;
width: 100px;
text-indent: -9999px;
background: url(http://favoritefm.com/wp-content/themes/FavClear/img/logo.png) 5% 50% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100px;
}
#main {
margin-left: 2px;
overflow: hidden;
}
#presenter {
margin-top: 40px;
width: 100%;
height: 40%;
overflow: hidden;
}
.presenter-one {
display: block;
height: 100%;
width: 50%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100% 100%;
}
.presenter-two {
float: left;
position: relative;
display: block;
height: 50%;
width: 25%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 266px 300px;
}
.presenter-three {
position: relative;
display: block;
height: 50%;
width: 25%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 266px 310px;
}
.presenter-four {
position: relative;
display: block;
height: 52%;
width: 25%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 266px 300px;
}
.presenter-five {
position: relative;
display: block;
height: 52%;
width: 25%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 266px 300px;
}
#media screen and (max-width: 965px) {
body {
width: 50%;
}
#main {
width: 50%
}
#media screen and (max-width: 365px) {
body {
width: 100%;
}
#wrapper {
width: 100%
margin: 0 auto;
}
#header {
width: 100%;
background: #2a2727;
color: #fff;
margin-top: 0px;
height: 100px;
}
.top-logo-container {
display: block;
height: 120px;
width: 120px;
text-indent: -9999px;
background: url(http://favoritefm.com/wp-content/themes/FavClear/img/logo.png) 5% 50% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 120px;
}
#main {
margin-left: 2px;
}
#presenter {
margin-top: 40px;
width: 100%;
height: 100%;
}
.presenter-one {
display: block;
height: 100%;
width: 100%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100% 100%;
}
.presenter-two {
display: block;
height: 50%;
width: 50%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100% 100%;
}
.presenter-three {
position: relative;
display: block;
height: 50%;
width: 50%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100% 100%;
}
.presenter-four {
position: relative;
display: block;
height: 50%;
width: 50%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100% 100%;
}
.presenter-five {
position: relative;
display: block;
height: 50%!important;
width: 50%;
text-indent: -9999px;
background: url(http://eastsbeach.com.au/assets/Uploads/_resampled/SetWidth2000-Kiama-Events-Easts-Beach-PB.jpg) 0% 0% no-repeat scroll;
margin: 0 auto;
position: relative;
float: left;
background-color: #000;
margin-top: -10px;
background-size: 100% 100%
}
}
You’ve missed closing your #media screen and (max-width: 965px) and setting your #wrapper to width: 100%; in this breakpoint. Then it will be responsive.
#media screen and (max-width: 965px) {
body {
width: 50%;
}
#wrapper {
width: 100%;
}
#main {
width: 50%
}
}
Additionally:
I don’t think it makes any sense to set the width of body and #main to 50 % here.
See JSFiddle
I'm trying to make the header of my site transparent using rgba code. But it doesn't work. Could you please help me to fix this problem?
Thanks in advance!
There is the header code:
/*==================== 3. Header ====================*/
.site {
margin: 0 auto;
width: 100%;
position: relative;
}
.site.full-banner {
padding-top: 0;
}
.site-main {
margin-bottom: 70px;
}
body.page-template-page-landing-php {
overflow: hidden;
}
.landing.site-main {
margin: 0;
padding: 0;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
}
.archive.woocommerce-page .site-main {
margin-bottom: 80px;
}
.site-header {
width: 100%;
z-index: 10000;
}
.full-banner .site-header {
position: absolute;
top: 0;
}
.site-header.header-1{
background: url('../images/header_bg.png') !important;
}
.site-header.header-2 {
background: rgba(218, 202, 202, .5);
}
.header-relative .site-header {
position: relative;
}
.header-absolute .site-header {
position: absolute;
}
/*========== 3.1 Header Top ==========*/
.header-top {
line-height: 15px;
min-height: 35px;
}
.header-2 .header-top {
min-height: 36px;
}
.site-header,
.site-header a,
.toplinks a,
.mini-cart .mobile-hide .subtotal .amount {
color: #dadada;
}
.header-2 .header-top {
border-bottom: 1px solid #242424;
-webkit-box-shadow: 0 1px 0 rgba(128,128,128,.15);
-moz-box-shadow: 0 1px 0 rgba(128,128,128,.15);
box-shadow: 0 1px 0 rgba(128,128,128,.15);
}
.header-2 .header-container {
min-width: 750px;
}
.main-header.fixed {
position: fixed;
background: rgba(218, 202, 202, .5);
width: 100%;
height: 77px;
left: 0; top: -7px;
z-index: 10000;
}
.main-header.fixed .navbar {
background: none;
}
.main-header.fixed .header-top {
display: none;
}
#primary {
width: 75%;
margin: 0;
float: left;
}
.full-width #primary {
width: 100%;
float: none;
}
#primary {
width: 100%;
}
.left-sidebar #primary {
width: 75%;
float: right;
}
.right-sidebar #primary {
width: 75%;
float: left;
}
.entry-header,
.entry-content,
.entry-summary,
.entry-meta {
margin: 0 auto;
width: 100%;
}
.entry-header h1 {
font-size: 15px;
}
In CSS 3, they introduced opacity.
opacity: 0.9;
It takes values from 0.0(invisible) to 1.0(opaque).
Let me know if it doesn't work for you. :-)
P.S. Not sure what the browser compatability is like, but so far it's working for me.
This should be fairly simple but for some reason I can't get my "footer" div to be placed at the bottom of the "container" div. This pertains to the master page format so if I adjust it to look good on one page it won't on another. Can someone take a quick look and help me out?
#container {
background-color: #fafafa;
height: auto;
width: 1112px;
margin: 0 auto 0 auto;
position: relative;
}
#footer {
background-color: #fafafa;
width: 1112px;
height: 25px;
margin-left: auto;
margin-right: auto;
position: absolute;
bottom: 0;
}
#ftr-nav {
position: absolute;
bottom: 0;
right: 0;
float: right;
padding: 15px 30px 0 0;
}
.ftr-link-home {
font: 9px #0094ff;
}
.ftr-link-admin {
font: 9px #0094ff;
}
#copy {
float: right;
padding: 0 15px 0 0;
font-size: small;
position: absolute;
right: 115px;
bottom: 0;
}
http://jsfiddle.net/Develop_er/c32Mm/2/
Add this:
html,body
{
height: 100%;
}
#container {
background-color: #fafafa;
height: 100%; /* <--- */
width: 1112px;
margin: 0 auto 0 auto;
position: relative;
}
FIDDLE
Yes. Adding height to the #container places everything right.