i'm using the visual composer plugin which makes it easy to create columns. i've reached a issue where i want to create a sepa
html,body { height:100%;width:auto;}
.left {
float: left;
}
#w1 {width:22%;
background-color:#009;
margin-right: 4%;
}
#w2{width:48%;
background-color:#9F3;
margin-right: 4%;
}
#w3{ width:22%;
background-color:#30C;}
<div class="left" id="w1">TEST</div>
<div class="left" id="w2">TEST</div>
<div class="left" id="w3">TEST</div>
rator line between the columns how can this be done in an easy way? I've recreated how the 3 columns are set up below:
You could use :after :pseudo-elements.
html,
body {
height: 100%;
width: auto;
}
.left {
float: left;
position: relative;
}
#w1 {
width: 22%;
background-color: #009;
margin-right: 4%;
}
#w2 {
width: 48%;
background-color: #9F3;
margin-right: 4%;
}
#w3 {
width: 22%;
background-color: #30C;
}
.left:not(:nth-of-type(2)):after {
content: '';
position: absolute;
right: -10%;
top: 0;
height: 100%;
width: 2px;
background: black;
}
.left:last-of-type:after {
right: 108%;
}
<div class="left" id="w1">TEST</div>
<div class="left" id="w2">TEST</div>
<div class="left" id="w3">TEST</div>
Related
I'm trying to make a button that looks like this:
https://postimg.cc/HcG72DCf
and this:
https://postimg.cc/1nkXSpz2
Here is my codepen to try & copy it:
https://codepen.io/assilem4791/pen/KKBoLOm
.buttonContainer {
position: relative;
height: 200px;
width: 500px;
background-color: lightgray;
border-radius: 40px;
align-items: center;
}
.buttonstripes {
position: absolute;
background-color: gray;
height: 5%;
width: 100%;
left: 0;
z-index:1;
}
#stripe1 {
top: 30%;
}
#stripe2 {
top: 40%;
}
#stripe3 {
top: 50%;
}
#stripe4 {
top: 60%;
}
#stripe5 {
top: 70%;
}
.offAir {
postion: absolute;
height: 80%;
width: 70%;
background-color: lightyellow;
border-radius: 40px;
font-size: 50px;
align: center;
z-index: 2;
}
<div class="buttonContainer">
<div class="buttonstripes" id="stripe1"></div>
<div class="buttonstripes" id="stripe2"></div>
<div class="buttonstripes" id="stripe3"></div>
<div class="buttonstripes" id="stripe4"></div>
<div class="buttonstripes" id="stripe5"></div>
<div class="offAir"> <p>OFF AIR</p>
</div>
I'm having trouble with making the stripes sit behind the offAir div.
Any help would be appreciated!
I thought putting a div inside another div with a z-index would work.
Below is the screenshot that contains OK text as an element and 2 other elements in the left & right side and in the last buttons.
.center-text {
font-weight: bold;
font-style: normal;
text-align: center;
font-size: 25px;
line-height: 30px;
letter-spacing: normal;
opacity: 1.0;
margin-top: 25% !important;
}
.lower-content {
margin-bottom: 30px;
}
.group:before, .group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}
.group {
clear: both;
*zoom: 1;
}
.lower-content-left {
float: left;
margin: 0 1.5%;
width: 63%;
}
.lower-content-right {
float: right;
margin: 0 1.5%;
width: 30%;
}
.button-left {
position: absolute;
width: 140px;
height: 140px;
left: 100px !important;
right: 0;
bottom: 0;
top: 620px;
}
.button-left>div {
width: 100px;
height: 100px;
}
.notification-button {
margin-left: 15px;
margin-top: 10px;
zoom: 2.0;
}
.button-right {
position: absolute;
width: 140px;
height: 140px;
left: 250px;
right: 20px;
bottom: 0;
top: 620px;
}
.button-right>div {
width: 100px;
height: 100px;
}
.heart-button {
margin-left: 15px;
margin-top: 10px;
zoom: 2.0;
}
<div class="center-text">Ok</div>
<div class="group">
<div class="lower-content-left">
<div class="lower-left">click here</div>
<div class="search-channels">Click
<br>Here</div>
</div>
<div class="lower-content-right">
<div class="lower-right">Otherwise Click here</div>
<div class="qrCode">Click here
<br>Also</div>
</div>
<div class="button-left">
<div>
<ion-icon name="notification" class="notification-button"></ion-icon>
</div>
</div>
<div class="button-right">
<div>
<ion-icon name="heart" class="heart-button"></ion-icon>
</div>
</div>
Problem : When I change the width of the screen the buttons hide away or is not present at the present position and same for all elements.
I have posted in the screenshot.I just need to edit my css to make it responsive according to the screenshot.
Try to use to css by resolution.
Example:
#media (max-width: 300px) {
.your-class {
your:option; }
}
#media (max-width: 600px) {
.your-class {
your:option; }
}
So I'm really new using CSS, I need to add 3 vertical red lines on top of an image, the lines have to split the image in 4 equally sized parts. The size of the image is always 465*346 and the mark up I have so far looks like this
CSS:
.logo-container {
position: relative;
height: 87px;
width: 35%;
margin: 0 auto;
min-width: 144px;
}
.logo {
position: relative;
width: 72px;
height: 87px;
z-index: 2;
}
.logo-line {
position: relative;
display: inline-block;
top: -50%;
width: 20%;
height: 2px;
background: #333;
}
HTML:
<div id="preview-image-wrapper">
<span class="firstOverlayLine" ></span>
<span class="secondOverlayLine"></span>
<span class="thirdOverlayLine"></span>
<img id="mainImage" type="image" class="mainimage" data-bind="attr: {src: SelectedImagePath}" />
</div>
The above is my attempt to modify this example to make it fit my needs, but with no success so far.
The end result should look like:
You can do something raw like this - floating 1px-wide spans over the image, keeping your original HTML:
div {
width: 465px;
position: relative;
}
span {
position: absolute;
display: block;
height: 346px;
width: 1px;
background: red;
}
.firstOverlayLine {
left: 25%;
}
.secondOverlayLine {
left: 50%;
}
.thirdOverlayLine {
left: 75%;
}
<div id="preview-image-wrapper">
<span class="firstOverlayLine"></span>
<span class="secondOverlayLine"></span>
<span class="thirdOverlayLine"></span>
<img src="http://placehold.it/465x346">
</div>
You could use :before and :after :pseudo-elements.
#img {
position: relative;
width: 465px;
height: 346px;
background: url(http://dummyimage.com/465x346/ddd5ed/fff);
border: 1px solid red;
}
#img:before, #img:after {
position: absolute;
content: '';
width: 25%;
height: 100%;
top: 0;
left: 25%;
border-left: 1px solid black;
border-right: 1px solid black;
box-sizing: border-box;
}
#img:after {
left: 75%;
border-right: 0;
}
<div id="img"></div>
Alternative using unordered list:
http://jsfiddle.net/a4q63mwc/
<div id="preview-image-wrapper">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<img src="http://placehold.it/465x346" />
</div>
div, img {
width: 465px;
height: 346px;
position: relative;
}
ul {
margin:0;
padding:0;
list-style-type: none;
position: absolute;
display: block;
height: 346px;
width:100%;
z-index:200;
overflow:hidden;
}
li {
height:346px;
border-right:1px solid red;
width:25%;
display:inline-block;
margin-right: -4px;
}
For a horizontal line, if someone needs it.
div {
width: 465px;
position: relative;
}
span {
position: absolute;
display: block;
height: 2px;
width: 465px;
background: red;
}
.firstOverlayLine {
top: 50%;
}
<div id="preview-image-wrapper">
<span class="firstOverlayLine"></span>
<img src="http://placehold.it/465x346">
</div>
I have a div inside a div that will not move up into the center where I want it to. It is the image called youthcouncil
HTML
<div id="header">
<img src="file:///E:/Crios%20Óige/Crios%20Oige%20Images/Logo.png" id="logo">
<img src="file:///E:/Crios%20Óige/Crios%20Oige%20Images/Title.PNG" id="title">
<img src="http://www.youtharts.ie/sites/youtharts.ie/files/NYCI%20Logo%20Full%20JPG_2.jpg" id="youthcouncil">
</div>
Corresponding CSS
#header {
height: 100px;
width: 2000px;
background-color: #993333;
margin-top: -10px;
}
#youthcouncil {
height: 80px;
width: 180px;
margin-left: 300px;
margin-top: 5px;
}
#logo {
height: 80px;
width: 180px;
margin-left: 20px;
margin-top: 5px;
}
#title {
height: 80px;
width: 180px;
margin-left: 250px;
margin-top: 5px;
}
UPDATED
I removed some parts for you, to make it easier to see how it works. Now you should be able to add back your other images etc.
Demo: http://jsfiddle.net/UKAEu/2/
HTML
<div id="header">
<img src="http://www.youtharts.ie/sites/youtharts.ie/files/NYCI%20Logo%20Full%20JPG_2.jpg" id="youthcouncil" />
</div>
CSS
#header {
height: 100px;
width: 500px;
background-color: #993333;
}
#youthcouncil {
height: 80px;
width: 180px;
margin-top: 10px;
position: relative; /* make it moveable */
left: 50%; /* push left edge to center */
margin-left: -90px; /* push back half its width */
}
Let's just say I have three divs: DIV1, DIV2, DIV3 is this particular order.
I would like to stack them like that:
(BIG|DIV1
DIV2)|DIV3
I have tried with positioning and floats, unfortunately DIVs just overlaped, hide or stacked one under the another.
Any help or advice would be great.
UPDATED
My current code:
.div1
{
position: absolute;
margin-left: 125px;
width: 500px;
}
.div2
{
position: relative;
}
.div3
{
clear: both;
}
And the result:
(BIG|DIV1
DIV2)|
DIV3
HTML:
<div class="div1">DIV1</div>
<div class="div2">(BIG <br /> DIV2)</div>
<div class="div3">DIV3</div>
This solution employs a relatively-positioned wrapper. I'm hoping that this is available to you.
http://jsfiddle.net/LLRR8/2/
#div1 {
height: 50%;
position: absolute;
right: 0;
top: 0;
margin-left: 120px;
}
#div2 {
height: 100%;
width: 120px;
position: absolute;
left: 0;
top: 0;
}
#div3 {
height: 50%;
position: absolute;
top: 50%;
right: 0;
margin-left: 120px;
}
#wrapper {
position: relative;
}
<div id="wrapper">
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
</div>
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
#div1{
width:200px;
height: 50px;
clear: both;
}
#div2{
width:100px;
height: 50px;
float: left;
}
#div3{
width:100px;
height: 50px;
float: left;
}
it would help if you'd post what code you have tried. If i'm understanding what you want right, this should do it:
#one {
clear: both;
height: 15%;
width: 40%;
margin-right: 0px;
margin-left: auto;
}
#two {
margin-right: auto;
margin-left: 0px;
float: left;
}
#three {
margin-right: 0px;
margin-left: auto;
}