I have a problem implementing this schema:
Here is a jsfiddle: http://jsfiddle.net/ptCoder/3WB32/
The "Bar 2" need to be rotate in vertical:
transform: rotate(90deg);
-ms-transform: rotate(90deg); /* IE 9 */
-webkit-transform: rotate(90deg); /* Safari and Chrome */
Can anyone help me?
Thank You.
You could fudge something like this together DEMO http://jsfiddle.net/kevinPHPkevin/3WB32/5/
<div class="container">
<div id="hbar">Bar 1</div>
<div id="vbar">Bar 2</div>
<canvas id="c" width="400px" height="400px">CANVAS</canvas>
</div>
Below is a custom approach I've built, it personally makes more sense to me to do it this way. You can see how it functions / looks by clicking on the example on the bottom.
The HTML:
<div id="wrapper">
<div id="bar-1">
<p>Bar 1</p>
</div>
<div id="bar-2">
<p>Bar 2</p>
</div>
<div id="canvas">
This is the canvas
</div>
</div>
The CSS:
#wrapper{
min-height: 500px;
position: relative;
background: #ccc;
}
#bar-1{
position: absolute;
left: 100px;
right: 100px;
background: blue;
height: 100px;
}
#bar-2{
position: absolute;
top: 100px;
background: red;
bottom: 100px;
width: 100px;
}
#canvas{
position: absolute;
top:100px;
left: 100px;
background: yellow;
bottom: 100px;
right: 100px;
}
Click here for a working example of the above code:
You are giving same class to both div
<div id="hbar" class="hbar">Bar 1</div>
<div id="vbar" class="hbar">Bar 2</div>
change second one to vbar
Related
What element do I need to create black lines in the image ? [![enter image description here][1]][1]
I have written code but I need lines like image (create between images) how can I do this?
Please tell me
My codes are as follows:
using ":after" & ":before" you can set line between two images
.hiw-content .hiw-img img {
width: 100%;
height: auto;
padding: 100px;
}
div#a3:after {
z-index: 999;
content: '';
width: 150px;
background-color: black;
/* left: 0; */
height: 5px;
position: absolute;
right: -80px;
top: 50%;
border-radius: 100px;
}
div#a3:before {
z-index: 999;
content: '';
width: 150px;
background-color: black;
left: -80px;
height: 5px;
position: absolute;
/* right: 50%; */
top: 50%;
border-radius: 100px;
}
div#a3 {
overflow: visible;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="wrapper">
<div class="col-md-4 col-hiw col-hiw-bottom" id="a4">
<div class="hiw-content">
<div class="hiw-img"><img src=""></div>
<span class="hiw-title">Customer Service</span>
<p class="hiw-content">Let our dedicated customer service team take care of any inquiries</p>
</div>
</div>
<div class="col-md-4 col-hiw col-hiw-bottom" id="a3">
<div class="hiw-content">
<div class="hiw-img"><img src=""></div>
<span class="hiw-title">Order fulfilled</span>
<p class="hiw-content">Once a buyer places an order we’ll take care of order production and shipping.</p>
</div>
</div>
<div class="col-md-4 col-hiw col-hiw-bottom" id="a2">
<div class="hiw-content">
<div class="hiw-img"><img src=""></div>
<span class="hiw-title">Boost your sales</span>
<p class="hiw-content">Use Teesprings Boosted Network, Marketing Tools and Partnership Integrations </p>
</div>
</div>
</div>
It is easier to help you if you included more detailed code, the code above really doesn't help, to create a simple line you can do something like this (adjust margin and height/width appropriately) :
.underline {
width: 5rem;
height: 0.25rem;
background: #000;
}
<div class="underline"></div>
I've wrote the following CSS that uses pseudo elements to design a footer.
Looks like it works fine on Chrome & Firefox on windows but on Safari the footer_il::after goes on the bottom of the page.
When im adding margin-top: -20em; on .footer_il::after it's working the way i want it but it obviously breaks on other browsers.
.footer_il::before {
width: 75px;
height: 70px;
-webkit-transform: rotate(134deg);
-ms-transform: rotate(134deg);
transform: rotate(134deg);
left: calc(100% - 463px - 85px);
margin-top: -2em;
}
.footer_il::after {
height: 54px;
left: 0;
width: calc(100% - 449px - 63px);
}
.footer_il::before,
.footer_il::after {
z-index: 100;
position: absolute;
content: "";
background-color: #f7f7f7
}
.footer {
height: 20em;
background-color: #000;
width: 100%;
display: inline-flex;
}
<!-- Footer -->
<footer class="footer_il bg-light">
<div class="footer">
<div class="footer_section_1">
<div class="footer_container">
<div class="footer_branding">
<div class ="footer_logo">
</div>
</div>
</div>
</div>
<div class="footer_section_2">
</div>
<div class="footer_section_3">
<div class="footer_container">
</div>
</div>
<div class="footer_section_4">
</div>
</div>
</footer>
So just by playing around a bit i ended up with the following result. Thanks to pschueller for the hint.
I've added the entire footer into a container. Set the class in absolute position and 100% width. Then added inside the ::after class 0 distance from top.
Now it's working on Mac OS Safari. Because there wasn't a top before it was getting outside of it's intended position.
.footer_entire_container {
position: absolute;
width: 100%;
}
.footer_il::before {
width: 75px;
height: 70px;
-webkit-transform: rotate(134deg);
-ms-transform: rotate(134deg);
transform: rotate(134deg);
left: calc(100% - 463px - 85px);
margin-top: -2em;
}
.footer_il::after {
height: 54px;
left: 0;
top: 0;
width: calc(100% - 449px - 63px);
}
.footer_il::before,
.footer_il::after {
z-index: 100;
position: absolute;
content: "";
background-color: #f7f7f7
}
.footer {
height: 20em;
background-color: #000;
width: 100%;
display: inline-flex;
}
<!-- Footer -->
<div class="footer_entire_container">
<footer class="footer_il bg-light">
<div class="footer">
<div class="footer_section_1">
<div class="footer_container">
<div class="footer_branding">
<div class ="footer_logo">
</div>
</div>
</div>
</div>
<div class="footer_section_2">
</div>
<div class="footer_section_3">
<div class="footer_container">
</div>
</div>
<div class="footer_section_4">
</div>
</div>
</footer>
</div>
I need this markup to then use in an animation. This animation should use relative values almost anywhere to scale without breaking and look similar anywhere. display: flex and its aligns and justifies work wrong in my situation, so I went here to ask.
This is my markup:
.a-parent {
height: 100px;
width: 100px;
border-radius: 50%;
background-color: #f0f0f0;
}
.a-child {
height: 10%;
width: 10%;
background-color: #0099ff;
border-radius: 50%;
}
<div class="a-parent">
<div class="a-child"></div>
<div class="a-child"></div>
<div class="a-child"></div>
<div class="a-child"></div>
<div class="a-child"></div>
</div>
How could I center all 5 a-child elements over each other to make it look like this?
EDIT: fixed my html, sorry.
Use position relative on the .a-parent and absolute on a-child and align children horizontally and vertically center in the parent.
.a-parent {
height: 100px;
width: 100px;
border-radius: 50%;
position: relative;
background-color: #aaaaaa;
}
.a-child {
height: 10%;
width: 10%;
background-color: #0099ff;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
<div class="a-parent">
<div class="a-child"></div>
<div class="a-child"></div>
<div class="a-child"></div>
<div class="a-child"></div>
<div class="a-child"></div>
</div>
Hi I'm trying to create a collage of three images, like the concept shown in this site: https://codepen.io/zacharybrady/pen/aGmFp
The HTML:
<div class="container">
<div class="diagonal" id="d0">
<img src="http://www.shortpacked.com/comics/2013-02-08-prologue.png" />
<p class="overlay">
TEST
</p>
</div>
<div class="diagonal" id="d1">
<img src="http://www.questionablecontent.net/comics/2381.png" />
<p class="overlay">
TEST
</p>
</div>
<div class="diagonal" id="d2">
<img src="http://www.shortpacked.com/comics/2005-01-17-bow-before-your-master.gif" />
<p class="overlay">
TEST
</p>
</div>
<div class="diagonal" id="d3">
<img src="http://www.questionablecontent.net/comics/2021.png" />
<p class="overlay">
TEST
</p>
</div>
<div class="diagonal" id="d4">
<img src="http://www.shortpacked.com/comics/2009-03-27-fourohfour.png" />
<p class="overlay">
TEST
</p>
</div>
</div>
THE CSS:
#import "compass/css3";
#import "compass/css3";
body{
background: blue;
}
.container{
width: 800px;
height: 400px;
background: white;
overflow: hidden;
position: relative;
margin-left: 100px;
.diagonal{
height: 1200px;
width: 200px;
overflow: hidden;
#include rotate(25deg);
position: absolute;
top: -200px;
img{
#include rotate(-25deg);
margin-top: -100px;
margin-left: -200px;
}
.overlay{
#include rotate(-25deg);
height: 1200px;
width: 800px;
position: absolute;
top: -50px;
left: 0;
background: black;
opacity: 0;
color: white;
-webkit-transition: opacity .5s;
vertical-align: middle;
text-align: center;
&:hover{
opacity: .8;
}
}
&#d0{
left: -180px;
}
&#d1{
left: 40px;
}
&#d2{
left: 260px;
}
&#d3{
left: 480px;
}
&#d4{
left: 700px;
}
}
}
Question: How can I add additional transitions that when a specific image is hovered, it will expand to its full width?
PLEASE DON'T MARK this as duplicate or close this for having ambiguous question, because I know and you know the question there is clear and understandable.
You could change the z-axis on hover, so that the full image comes to the front.
I have a selection of squares (squares turned 45° to look like diamonds) which I want to use to make up a big diamond shape with a central red diamond.
I am having issues organising the diamonds themselves and the href seems to fail.
How do I position the responsive diamonds in a regular grid?
Her is my code:
body {
background: black;
color: #000000;
font: 13px georgia, serif;
line-height: 1.4;
font-weight: lighter;
text-rendering: optimizelegibility;
}
#diamond {
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom-color: white;
position: relative;
top: -50px;
}
#diamond:after {
content: '';
position: absolute;
left: -50px;
top: 50px;
width: 0;
height: 0;
border: 50px solid transparent;
border-top-color: white;
}
#diamond_red {
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom-color: #AA1C08;
position: relative;
top: -50px;
}
#diamond_red:after {
content: '';
position: absolute;
left: -50px;
top: 50px;
width: 0;
height: 0;
border: 50px solid transparent;
border-top-color: #AA1C08;
}
<a class="navigation">
<center>
<div id="diamond"></div>
<div id="diamond"></div>
<div id="diamond" href="/photos/"></div>
<div id="diamond_red"></div>
<div id="diamond" href="/projects/"></div>
<div id="diamond"></div>
<div id="diamond"></div>
<div id="diamond" href="/archive/"></div>
</center>
</a>
The responsive grid of diamons:
I don't think you have the right aproach to achieve a regular responsive diamond grid layout. It would be much simpler to:
create a responsive grid of squares (3x3 or whatever grid you feel like)
then rotate the grid 45 degrees.
That way you won't have to fiddle with borders, pseudo elements (:after, :before) and positioning each diamond.
Here is a responsive example
It uses percentage width and padding-bottom to keep the diamonds responsive and transform:rotate(45deg); to rotate te whole grid and make it look like a diamond grid:
body{background:#000;}
#big_diamond {
width: 50%;
margin:15% auto;
overflow:hidden;
transform: rotate(45deg);
}
.diamond {
position: relative;
float: left;
width: 31.33%;
padding-bottom: 31.33%;
margin: 1%;
background: #fff;
transition:background-color .4s;
}
.diamond a {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
}
#red{background-color: #AA1C08;}
.diamond:hover, #red:hover{background-color:darkorange;}
<div id="big_diamond">
<div class="diamond"></div>
<div class="diamond"></div>
<div class="diamond"></div>
<div class="diamond"></div>
<div class="diamond" id="red"></div>
<div class="diamond"></div>
<div class="diamond"></div>
<div class="diamond"></div>
<div class="diamond"></div>
</div>
As other people have mentioned, there are some errors in your HTML that I corrected like: Ids need to be unique and href can't be used on divs.
You're going to need to be more specific / clear on your first question.
First of all, you are using the ID 'diamond' many times. IDs are meant to be unique and used for one element. You should be using classes for this, not IDs.
Second, you can't use href within div tags. You could wrap the divs in a tags like this:
<div class="diamond"></div>
Or, even better so that the whole shape is clickable you can put the a inside of the div and make the a a block level element that is 100% width and height like this:
<div class="diamond"></div>
div a{
width: 100%;
height: 100%;
display: block;
}
JSFiddle Example: http://jsfiddle.net/kQj24/1/
This html has fallback for browsers that don't support transform in that the diamond becomes a square. Also the <div> elements can be wrapped in <a> tags using this method without altering any existing css rules for a. If transform isn't supported the text inside the square class doesn't rotate either.
<center>
<div class="diamond">
<div class="row">
<div class="square"><p>Text</p></div>
<div class="square"></div>
<div class="square"><p>Text</p></div>
</div>
<div class="row">
<div class="square"><p>Text</p></div>
<div class="square red"><p>Text</p></div>
<div class="square"><p>Text</p></div>
</div>
<div class="row">
<div class="square"><p>More</p></div>
<div class="square"></div>
<div class="square"><p>Text</p></div>
</div>
</div>
</center>
CSS, using your existing body rule:
.diamond {
padding-top: 50px;
transform:rotate(45deg);
-ms-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
}
.square {
background-color: white;
display: inline-block;
height: 50px;
overflow: hidden;
width: 50px;
}
.square:hover {
background-color: green;
}
.square p {
transform:rotate(-45deg);
-ms-transform:rotate(-45deg);
-webkit-transform:rotate(-45deg);
}
.red {
background-color: red;
}
http://jsfiddle.net/5Q8qE/8/