I am using bootstrap for my column structure and want to draw a horizontal line between the columns:
<div class="col-md-2 col-xs-12">
<div class="col-md-2 icon">
<i class="fa fa-bandcamp" aria-hidden="true"></i>
</div>
<div class="col-md-10 height hidden-xs">
<p>mycomp account number</p><span class="text">2000299999940</span>
</div>
<div class="visible-xs height">
<hr>
<p class="col-xs-5">mycomp account number:</p>
<p class="col-xs-7">2000299999940</p>
</div>
</div>
<div class="col-md-1">
<hr class="line" />
</div>
css:
.line {
width: 200px;
height: 3px;
background-color: #dadada;
margin-right:40px;
}
Because of the bootstrap columnstructure there are margins involved, but how can I make the line without all the space ie make it wider? Codepen here
well in case you want to ignore the default padding and margin in bootstrap make a class in css file as
.no-padding-margin
{
padding:0px;
margin: 0px;
}
and then apply this class to your bootstrap columns as
<div class="col-md-2 col-xs-12 no-padding-margin">
<div class="col-md-2 icon">
<i class="fa fa-bandcamp" aria-hidden="true"></i>
</div>
<div class="col-md-10 height hidden-xs">
<p>mycomp account number</p><span class="text">2000299999940</span>
</div>
<div class="visible-xs height">
<hr>
<p class="col-xs-5">mycomp account number:</p>
<p class="col-xs-7">2000299999940</p>
</div>
</div>
<div class="col-md-1 no-padding-margin">
<hr class="line" />
</div>
well as i understand you just want your line to be longer .
so why don't you remove the paddings from the col the line is in. and also add width:100% on the .line if you want.
code :
.line {
width: 100%;
height: 3px;
background-color: #dadada;
}
.col-md-1 {
padding-left:0;
padding-right:0;
}
Related
I have been using float layout UI for my webpage. Recently i thought to convert the same layout into flex display layout. I havent been much into flex displays and i am a complete newbie into flex layout. I am struggling to convert my webpage layout into flex display. If any one could give just a gist to some properties for the UI would be helpful. I tried some with flex display but struggled with the left banner (expressed in a HTML skeleton below) as it is completely breaking the row system.
I have posted the HTML and CSS in a fiddle. Link to which is shared.
.left-block {
padding: 24px;
height: 100vh;
display: table-cell;
width: 41.66666667%;
margin: 0px;
background: #333;
/*padding: 24px 24px 0 24px;*/
}
.right-block {
padding: 24px 24px;
height: 100vh;
display: table-cell;
width: 58.33333333%;
}
.container-fluid {
max-width: 100%;
/*border-left: 1px solid #ccc;
border-right: 1px solid #ccc;*/
}
<div class="container-fluid">
<div class="row">
<div class="col-md-6 left-block">
<img src="~/images/logo.png" class="pull-left logo" />
<span class="pull-left company-name">Company Name<sup>TM</sup> </span>
<div class="clearfix"></div>
<p>
Sign in to your account.
</p>
</div>
<div class="col-md-6 right-block">
<div id="SignInBlock">
<p class="pull-right">
<span class="noacct">Don’t have an account?</span> Create account
</p>
<div class="clearfix"></div>
<div class="form-wrapper">
<h1>Sign in</h1>
<form action="#">
<div class="form-group">
<input type="email" class="form-control" id="work_email" required placeholder="Work Email">
</div>
<button type="submit" disabled class="btn btn-big btn-primary col-xs-12">Sign in</button>
</form>
<p class="forgot-password">
<strong>Forgot email?</strong>
</p>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
https://jsfiddle.net/u9wz18br/
<div class="left-block">
<!-- Full height banner with 40% width -->
// Some Text
</div>
<div class="right-block">
<!-- Create Account Link floating right -->
// Sign In Block Here
</div>
So, I have to create this Page where in you get text alongside image displayed as seen in here
But , on minimising the window size the image gets overlapped as seen here
<div class="header1">
<div class="col-md-8">
<h4 class="hedtext">Name</h4>
</br>
<h4 class="hedtext">Address</h4>
</br>
<h4 class="hedtext">Contact Number</h4>
</br>
<h4 class="hedtext">Fax</h4>
</div>
<div class="col-md-4">
<img src="https://images.pexels.com/photos/248797/pexels-photo-248797.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" class="pull-right img1">
</div>
</div>
and Here is the css
.hedtext {
padding-top:10px;
margin-bottom: -19px;
line-height: 2pt;
font-size: 13px;
font-weight: 750;
float: left;
}
.header1 {
border: 1px solid black;
height: 150px;
}
.img1 {
width: auto;
height: 130px;
padding :10px;
}
Also, using bootstrap 3 . All i want is that the image goes side by side the text on minimising the window size .
First you have forgot to add the .row class div which bootstrap requires to wrap around the columns to work correctly.
I removed .pull-right and instead just added text-right to the column. You can also use floats though or whatever to set the image to the right side however you wish.
<div class="header1 row">
<div class="col-md-8">
<h4 class="hedtext">Name</h4>
</br>
<h4 class="hedtext">Address</h4>
</br>
<h4 class="hedtext">Contact Number</h4>
</br>
<h4 class="hedtext">Fax</h4>
</div>
<div class="col-md-4 text-right">
<img src="https://images.pexels.com/photos/248797/pexels-photo-248797.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
class="img1">
</div>
</div>
You have to wrap col in row
Remove the .hedtext - float (bootstrap worry about float)
Remove .header1 height: 130px; (It the reason image out of border)
See working code
.hedtext {
line-height: 2pt;
font-size: 13px;
font-weight: 750;
}
.row {
border: 1px solid black;
}
.img1 {
width: auto;
height: 130px;
padding: 10px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col-md-8">
<h4 class="hedtext">Name</h4>
<h4 class="hedtext">Address</h4>
<h4 class="hedtext">Contact Number</h4>
<h4 class="hedtext">Fax</h4>
</div>
<div class="col-md-4">
<img src="https://images.pexels.com/photos/248797/pexels-photo-248797.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" class="img1">
</div>
</div>
</div>
you have to add responsive class in div like col-xs-* for responsive
do this for your solution
<div clss="row">
<div class="header1">
<div class="col-md-8 col-xs-8">
<h4 class="hedtext">Name</h4>
</br>
<h4 class="hedtext">Address</h4>
</br>
<h4 class="hedtext">Contact Number</h4>
</br>
<h4 class="hedtext">Fax</h4>
</div>
<div class="col-md-4 col-xs-4">
<img src="https://images.pexels.com/photos/248797/pexels-photo-248797.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
class="pull-right img1">
</div>
</div>
</div>
While zooming the page TEXT is overlapping with the Image, I am sharing my screenshot, Please look into that and can you please give me the solution.
Thanks in Advance...
This is the css Code, While zooming the page TEXT is overlapping with the Image,
.Pad{
padding: 60px 0px;
margin-top: -300px;
}
body {
margin: 0;
}
.outer-div-for-the-imgae-icon{position:relative; display:block; height:300px; width:300px; }
.outer-div-for-the-imgae-icon img{height:300px; width:300px; object-fit:cover;}
.outer-div-for-the-imgae-icon i{position:absolute; top:0; left:100%; font-size:40px;}
This is the HTML code, While zooming the page TEXT is overlapping with the Image,
<div class="col-12 col-12 p-0">
<div class="col-6 float-left">
<div class="outer-div-for-the-imgae-icon">
<app-image [imagesrc]="imagePath" style="width: 190px;max-height: 190px;clip-path: square(25px at center);"
class="d-none d-sm-block" alt="..."></app-image>
<i (click)="inputFile.click()" style="color : white;left: 180px;
position: absolute; top: -5px; padding: 3px; background-color: rgb(0, 195, 255);
border-radius: 50%;font-size: 12px;"
class="fa fa-pencil fa-lg" aria-hidden="true"></i>
</div>
<div class="col-6 Pad float-right">
<div class="col-sm ">
<span class="name">
<b style="color: rgb(25,25,112); font-size : 15px ">{{myprofile?.FirstName}}
{{myprofile?.LastName}}</b>
</span>
</div>
<div class="col-sm">
<span class="name">
<p>{{myprofile?.Role}}</p>
</span>
</div>
<div class="col-sm">
<span class="name">
<p>{{myprofile?.Phone}} {{myprofile?.UserName}}</p>
</span>
</div>
</div>
</div>
<!-- end snippet -->
Hi sandeep please try this and replace this css in you css and let me know if its fine.please adjust the min and max width and height according to you.
.outer-div-for-the-imgae-icon{position:relative; display:block; min-height:300px; width:100%; height:auto;} .outer-div-for-the-imgae-icon img{max-height:300px; width:100%; max-width:300px; height:auto; object-fit:cover;} .outer-div-for-the-imgae-icon i{position:absolute; top:0; left:100%; font-size:40px;}
I think this is overlapping only because we have given the image a fixed width and height .
EDIT:
so i've changed the code a bit and this is what you will need:
<style>
.Pad{
padding: 60px 0px;
margin-top: -300px;
}
body {
margin: 0;
}
.outer-div-for-the-imgae-icon{position:relative; display:block; height:300px; width:300px; }
.outer-div-for-the-imgae-icon img{height:300px; width:300px; object-fit:cover;}
.outer-div-for-the-imgae-icon i{position:fixed; top:0; left:100%; font-size:40px;}
</style>
<html>
<body>
<div class="col-12 col-12 p-0">
<div class="col-6 float-left">
<div class="outer-div-for-the-imgae-icon">
<app-image [imagesrc]="imagePath" style="width: 190px;max-height: 190px;clip-path: square(25px at center);"
class="d-none d-sm-block" alt="..."></app-image>
<i (click)="inputFile.click()" style="color : white;left: 180px;
position: absolute; top: -5px; padding: 3px; background-color: rgb(0, 195, 255);
border-radius: 50%;font-size: 12px;"
class="fa fa-pencil fa-lg" aria-hidden="true"></i>
</div>
<div class="col-6 Pad float-right">
<div class="col-sm ">
<span class="name">
<b style="color: rgb(25,25,112); font-size : 15px ">{{myprofile?.FirstName}}
{{myprofile?.LastName}}</b>
</span>
</div>
<div class="col-sm">
<span class="name">
<p>{{myprofile?.Role}}</p>
</span>
</div>
<div class="col-sm">
<span class="name">
<p>{{myprofile?.Phone}} {{myprofile?.UserName}}</p>
</span>
</div>
</div>
</div>
<div id="over" >
<img src="https://stepupandlive.files.wordpress.com/2014/09/3d-animated-frog-image.jpg"> some text
</div>
<div style="padding-left: 100px;" class="col-6 float-right">
<div class="col-12 ">
<div class="office-address-heading">
<p class="Address">Office Address</p>
</div>
<div class="d-flex align-items-center">
<!-- <i style="color:grey;" class="fa fa-map-marker fa-2x mr-2" aria-hidden="true"></i> -->
<address class="mb-0 size">
{{myprofile?.OfficeAddress}}
</address>
</div>
</div>
<hr />
<div class="col-12">
<div class="office-address-heading">
<p class="Address">Communication Details</p>
</div>
<div class="d-flex align-items-center office-address-details ">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style ="right: 14px;">
<div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 float-left">
<i class="fa fa-phone fa-2x mr-2" aria-hidden="true"></i>
<a style="color: black;" href="tel:1-562-867-5309">{{myprofile?.Phone}}</a>
</div>
<div class="d-flex1 col-xs-12 col-sm-12 col-md-8 col-lg-7 align-items-center office-address-details float-right ">
<i class="fa fa-envelope fa-2x mr-2" aria-hidden="true"></i>
<a style="color: black;" href="mailto:rafael.cepeda#lpl.com">{{myprofile?.Email}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
which you will get this result:
enter image description here
what i have changed is removing the css from the div that is responsible for the image, (bear in mind that i don't have the required files like photo's, links ect.... but this changed the image not overlapping the text.
reply if there is something wrong or if you have any questions
Hi guys so i have a background image with 5 small divs in it. I was wondering what is the best way to center the 5 divs in the middle of the image. I for some reason cant find a way to put it in the middle without using margin-left: 300px or something like this. I tried to use div align in the row but that doesn't work is well
HTML:
<div class="parallax2">
<div class="info1">
<span class="border"></span>
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-2" >
<!-- work_process -->
<div class="work_process">
<div class="work_process-box">
<i class="fa fa-lightbulb-o"></i>
<h4>IDEA</h4>
</div>
</div>
<!-- work_process -->
</div>
<div class="col-xs-6 col-sm-4 col-md-2">
<!-- work_process -->
<div class="work_process">
<div class="work_process-box">
<i class="fa fa-bank"></i>
<h4>DESIGN</h4>
</div>
</div>
<!-- work_process -->
</div>
<div class="col-xs-6 col-sm-4 col-md-2">
<!-- work_process -->
<div class="work_process">
<div class="work_process-box">
<i class="fa fa-comments-o"></i>
<h4>DEVELOP</h4>
</div>
</div>
<!-- work_process -->
</div>
<div class="col-xs-6 col-sm-4 col-md-2">
<!-- work_process -->
<div class="work_process">
<div class="work_process-box">
<i class="fa fa-desktop"></i>
<h4>TEST</h4>
</div>
</div>
<!-- work_process -->
</div>
<div class="col-xs-6 col-sm-4 col-md-2">
<!-- work_process -->
<div class="work_process">
<div class="work_process-box">
<i class="fa fa-rocket"></i>
<h4 id="three" >LAUNCH</h4>
</div>
</div>
<!-- work_process -->
</div>
</div>
</div>
</div>
CSS:
.parallax2 {
background-image: url(https://wallpapercave.com/wp/e7KiEL3.jpg);
min-height: 400px;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
padding: 10px 20px;
}
.work_process {
position: relative;
text-align: center;
margin: 0 auto;
}
.work_process .work_process-box {
outline: 4px solid #FFFFFF;
border-radius: 50%;
height: 120px;
margin: 2em auto 3em;
padding: 16px 10px;
width: 120px;
}
.work_process-box i {
font-size: 32px;
line-height: 52px;
width: 52px;
color: #FFFFFF;
}
.work_process-box h4 {
font-weight: 400;
margin: 0;
color: black;
}
I tried to add Margin-left: 200px in the work process class but i wasent sure if this is the correct way to do it.
Any help would be great
Link
#RonTheOld, you can turn your row into a flexbox by giving it the diplay:flex; property and 'justify-content: center' property to center the items in the flexbox.
I've done this as an inline style attribute on the row element for your code.
Here's a codeply project with the code in action.
Hi guys so i am using bootstrap and i have figured out how to put stuff on the right and left hand side of my footer, but i am not sure how to stick something in the middle
HTML:
<div class="footer">
<div class="container">
<div class="navbar-text pull-left">
<div class="logo1">
<p style="font-size: 24px; font-weight: 900; color: #F8BD23;">here</p>
<p>a,<br>
b,<br>
c,<br>
d<br></p>
</div>
</div>
<div class="navbar-text pull-right">
<i class="fa fa-facebook fa-2x"></i><i class="fa fa-instagram fa-2x"></i>
</div>
</div>
</div>
CSS:
.footer {
background-color: black;
padding-top: 10px;
}
.navbar-text > a {
color: #FFF;
padding: 5px;
}
.logo1 p {
color: #FFF;
margin-top: 2px;
}
Sorry just to clear up confusion, i want 3 columns basically So it should look like
Col 1 Col 2 Col 3
Fixed my own problem i guess just used a row and stuck 3 coloums in ,
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4"></div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4"></div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4"></div>
</div>
Had no idea i could use that in the footer, thanks again for the help x
Try like this:
Adding the "text-center" class to the container. So you will end up with this:
<div id="footer">
<div class="container text-center">
<p class="text-muted credit" style="color:#fff">xyz</p>
</div>
</div>