Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I had this structure and I want div "icon" to move dynamically when text is long
Any ideas ?
Thank you.
.tit {
display: table;
}
.icon {
border-top: 5px solid currentcolor;
border-right: 5px solid currentcolor;
min-width: 42px;
float: left;
height: 22px;
margin-top: -23px;
margin-left: 25px;
}
<div class="tit">Titleeeeeeeeeeeeeeeee</div>
<div class="icon"></div>
A wrapper as flexbox.
.wrapper {
display: flex;
}
.icon {
border-top: 5px solid currentcolor;
border-right: 5px solid currentcolor;
min-width: 42px;
height: 22px;
margin-left: -40px;
}
<div class="wrapper">
<div class="tit">Titleeeeeeeeeeeeeeeee</div>
<div class="icon"></div>
</div>
wrap the div class="tit" in div class="icon"
<div class="icon">
<div class="tit">Titleeeeeeeeeee</div>
</div>
jsfiddle example
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 2 years ago.
Improve this question
I am designing one card just like this.
I am wondering how to create a vertical line just below the circle as shown in the picture.
You can use CSS with position to achieve it along with ::before:
.circle {
width: 100px;
height: 100px;
border: 2px solid #ccc;
border-radius: 100%;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
position: relative;
margin-top: 50px;
}
.circle:first-child {
margin-top: 0;
}
.circle::after {
position: absolute;
content: "";
display: block;
border: 2px solid #ccc;
left: 50%;
bottom: 100%;
height: 50px;
margin-left: -2px;
}
.circle:first-child::after {
display: none;
}
<div class="wrap">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
Preview
adjust the height and width of horizontal to be a vertical line using hr tag
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am trying to make a CSS shape with a rounded bottom corner with border-radius, but failing to understand how to:
.rounded-css {
border-radius: 5px;
display: block;
background: #669999;
width: 150px;
height: 200px;
}
<div class="rounded-css"></div>
Expected output:
You can use border-radius: 0 0 50% 50%; to make the whole bottom part round. With adding a white pseudo element ::after, you can "cut" the unwanted upper part to only show the curve:
.rounded {
border-radius: 0 0 50% 50%;
display: block;
background: #669999;
width: 100%;
height: 70px;
margin-top: -35px;
}
.rounded::after {
content: "";
display: block;
width: inherit;
height: 35px;
background: white;
}
<div class="rounded"></div>
I think you can adapt this to the container you want to put this in. I think it's pretty much what you are looking for.
.rounded-css {
border-radius: 100%;
display: block;
background: black;
border-bottom: 40px #669999 solid;
border-top: 40px transparent solid;
position: relative;
top: -60px;
overflow: hidden;
}
<div class="rounded-css"></div>
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 6 years ago.
Improve this question
I just finished some courses in HTML and CSS, but I am clueless about how to create hexagons. I'm looking to create something like this using HTML and CSS:
This is what it looks like:
Thank you,Robert.
ps. I scored the web and stackoverflow, but did not find anything close.
All I found were big-huge hexagon grids, but any attempt to adjust resulted in loss of structure.
I would do something like this. Just see what I did with the middle and then apply that to the rest. Check out https://jtauber.github.io/articles/css-hexagon.html
.content {
width: 500px;
height: 500px;
background-color: #efefef;
z-index: 1;
}
.hex {
float: left;
margin-left: 3px;
margin-bottom: -26px;
}
.hex .top {
width: 0;
border-bottom: 30px solid #6C6;
border-left: 52px solid transparent;
border-right: 52px solid transparent;
}
.hex .middle {
width: 96px;
height: 60px;
background: transparent;
border: 4px solid #6C6;
}
.hex .bottom {
width: 0;
border-top: 30px solid #6C6;
border-left: 52px solid transparent;
border-right: 52px solid transparent;
}
.hex-row {
clear: left;
}
.hex-row.even {
margin-left: 53px;
}
<br/><br/>
<div class="content">
<div class="hex-row">
<div class="hex"><div class="top"></div><div class="middle"></div><div class="bottom"></div></div>
<div class="hex"><div class="top"></div><div class="middle"></div><div class="bottom"></div></div>
<div class="hex"><div class="top"></div><div class="middle"></div><div class="bottom"></div></div>
</div>
</div>
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 6 years ago.
Improve this question
I'm trying to create a jumbotron (maybe use another component) with left arrow attached that's pointing to the text in the left another column.
The image bellow shows exactly what i'm trying to do.
How exactly does this work and how is it accomplished?
left-arrow-box
This can be done by using another component with customized border attribute.
For example,
CSS:
.jumbo {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.jumbo .arrow {
width: 120px;
background-color: black;
color: #fff;
text-align: center;
padding: 5px 0;
position: absolute;
z-index: 1;
top: -5px;
left: 110%;
}
.arrow::after {
content: "";
position: absolute;
top: 20%;
right: 100%;
margin-top: -8px;
border-width: 20px;
border-style: solid;
border-color: transparent black transparent transparent;
}
HTML:
<div class="jumbo">
<span class="arrow">Jumbotron</span>
</div>
P.S. You may need to adjust the attributes to fit your needs.
Here is the jsfiddle
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 8 years ago.
Improve this question
I am using Bootstrap and I am trying to create a similar layout to one used by twitter as seen in the screenshot below.
The Part I am trying to do is where the profile picture is. I am trying to add a div that is positioned over another div and I really have no idea where to start.
I have the nav and the blue container but not sure how to create the div on top like shown.
http://www.bootply.com/v7fKXw63nh
Any ideas?
Try using the relative or absolute CSS positions.
For example, put the following code at the bottom of your example.
<div style="position: absolute;
left: 150px;
top: 120px;
width: 75px;
height: 75px;
background-color: #666"></div>
#profileWrapper {
width: 100%;
height: 150px;
background: lightgray;
position: relative;
}
#topHeader {
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
background: lightblue;
border-radius: 10px;
}
#profiler {
width: 100px;
height: 100px;
background: lightblue;
border: 5px solid lightgray;
border-radius: 5px;
position: absolute;
bottom: -50px;
left: 50px;
text-align: center;
}
.fa {
color: lightgray;
display: table-cell;
height: 200px;
vertical-align: middle;
}
.fa:hover {
color: white;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<div id="profileWrapper">
<div id="topHeader">
<div id="profiler"><span class="fa fa-camera fa-3x"></span>
</div>
</div>
</div>
Fiddle link (Don't forget to resize the demo section in fiddle)
HTML:
<div class="col-sm-12">
<div class="col-sm-2 col-xs-offset-1"></div>
</div>
CSS(used in the demo):
.col-sm-12{
height:100px;
background:#33CCFF ;
}
.col-sm-2{
height:150px;
background:#33CCFF;
margin-top:50px;
border: 4px solid white;
border-radius:5px;
}