thins are a little messy in different resolution - css

I have div like this
<div class="row ">
<div class="page-account-box ">
<div class="col-lg-6 col-md-6 mx-auto ">
<div class="account-box">
<div class="picture_account">
<img src="~/images/p1.jpg" class="imgFormat" style=" top: 60px; left: 60px;" />
</div>
<div class="account-box-content mt-3">
<form method="post" class="form-account" asp-action="signup" id="signupForm">
<div class="row pt-3 ">
<div class="col-6">
<div class="form-account-label-input ">
<label>Firstname<span class="star-red"> *</span></label>
<input asp-for="FirstName" type="text" class="w-100">
<span asp-validation-for="FirstName" class="text-danger star-red"></span>
</div>
</div>
<div class="col-6">
<div class="form-account-label-input">
<label>Lastname<span class="star-red"> *</span></label>
<input asp-for="LastName" type="text" class="w-100">
<span asp-validation-for="LastName" class="text-danger star-red"></span>
</div>
</div>
</div>
<div class="row pt-3 row-margin">
<div class="col-12">
<div class="form-account-label-input">
<label>Email</label>
<input asp-for="Email" type="text" class="w-100">
</div>
</div>
</div>
<div class="row pt-3 row-margin">
<div class="col-6">
<div class="form-account-label-input ">
<label>Password <span class="star-red"> *</span></label>
<input asp-for="Password" type="password" class="w-100">
<span asp-validation-for="Password" class="text-danger star-red"></span>
</div>
</div>
<div class="col-6">
<div class="form-account-label-input">
<label>Repeat Password <span class="star-red"> *</span></label>
<input asp-for="ConfirmPassword" type="password" class="w-100">
<span asp-validation-for="ConfirmPassword" class="text-danger star-red"></span>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
and this is Css
.page-account-box {
width: 100%;
}
.page-account-box .account-box {
width: 100%;
height: auto;
padding: 0;
border: 1px solid #e2efef;
-webkit-box-shadow: 0 12px 12px 0 hsla(0,0%,70.6%,.11);
box-shadow: 0 15px 23px 0 hsla(0, 0%, 71%, 0.29);
position: relative;
margin: 20px auto 30px;
display: flex;
background: #fff;
border-radius: 20px;
}
.page-account-box .account-box .picture_account {
display: inline;
}
.page-account-box .account-box .account-box-content {
min-height: 50%;
padding: 15px 20px;
border-radius: 20px;
width: 100%;
}
.page-account-box .account-box .picture_account .imgFormat {
-moz-box-shadow: 10px 10px 5px #ccc;
-webkit-box-shadow: 10px 10px 5px #ccc;
box-shadow: 10px 10px 5px #ccc;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
position: relative;
background-color: darkgoldenrod;
}
.form-account {
padding: 0px;
margin: 0px;
}
if I make in third line to , so it will be ok in 1280*1024 but ok in higher resolution
when the display is in 1920* 1080, it looks great, but when I change the display to 1280* 1024, it looks a little messy. how to make it to be ok in both resolution?

You should learn/explore media queries within CSS:
https://drafts.csswg.org/mediaqueries/#width
There are plenty of examples on how to use it:
/* here generic css*/
#media (min-width: 1280px) {
/* if width is at least 1280px, apply some change. Example: */
.page-account-box .account-box {
width: 90%;
height: auto;
}
}
or maybe you would need:
#media (400px <= width <= 700px) {
/* adjust for mobile devices within these constraints */
...
}

Related

Carousel doesn't work (have 2 carousel one page)

I have 2 Carousel in one page the fist one slides and indicators are working really good, but the second doesn't automatically slides and the buttons don't even work
tried a lot of stuff scripting didn't seem to work.
<header>
<div id="myCarousel" class="carousel slide" data-bs-ride="carousel" data-bs-interval="4000">
<ol class="carousel-indicators">
<li data-bs-target="#myCarousel" data-bs-slide-to="0" class="active"></li>
<li data-bs-target="#myCarousel" data-bs-slide-to="1"></li>
<li data-bs-target="#myCarousel" data-bs-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="container first-item">
<h1>Welcome to my protfolio</h1>
<!-- About me -->
Contact Me
</div>
</div>
<div class="carousel-item">
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-3 col-lg-3 col-xl-3 col-xxl-3"> Work Experience</div>
<div class="col-3 col-lg-3 col-xl-3 col-xxl-3">Education</div>
<div class="col-3 col-lg-3 col-xl-3 col-xxl-3">Skills</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="container">
<!-- About me -->
<h1>Third Item</h1>
</div>
</div>
</div>
</div>
</header>
<!-- #Main Body -->
<div class="container-fluid main">
<!-- #About -->
<div class="row section" id="about">
<div class="col-8">Column</div>
<div class="col-4">Column</div>
</div>
<!-- #Jobs -->
<div class="row section" id="jobs">
<div class="col-6 col-xl-6 col-xxl-6">
<div class="card">
<img src="StyleSheet/Working.jpg" class="card-img-top" />
<!---Card For Work Experience------------------>
<div class="card-body">
<h5 class="card-title">work experience</h5>
<p class="card-text "></p>
My Resume
</div>
</div>
</div>
<div class="col-6 col-xl-6 col-xxl-6 ">
<div class="container ">
<div class="row justify-content-center ">
<div class="col-12 ">
<h1>
<span class="material-icons-round "> work_history </span> Work Experience
</h1>
</div>
</div>
<div class="row ">
<figure>
<blockquote class="blockquote ">
<li>Bright Data ( former Luminati )</li>
</blockquote>
<figcaption class="blockquote-footer ">
( 2021 - Current )
</figcaption>
</figure>
</div>
<div class="row ">
<figure>
<blockquote class="blockquote ">
<li>Rafael Industry</li>
</blockquote>
<figcaption class="blockquote-footer ">
( 2017 - 2019 )
</figcaption>
</figure>
</div>
<div class="row ">
<figure>
<blockquote class="blockquote ">
<li>IDF</li>
</blockquote>
<figcaption class="blockquote-footer ">
( 2014 - 2017 )
</figcaption>
</figure>
</div>
</div>
</div>
</div>
<!-- #Projects -->
<div class="row section justify-content-center">
<!-- #Projects-Carousel -->
<div id="projects-carousel " class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner ">
<!-- #Projects-1 -->
<div class="carousel-item active ">
<div class="container ">
<div class="row justify-content-center ">
<img class="col-lg-8 " src="StyleSheet/Working.jpg " />
<div class="col-xl-3 col-md-4 card ">
<div class="card-header text-center ">
Featured
</div>
<img src="StyleSheet/Working.jpg " class="card-img " />
<div class="card-body ">
<h5 class="card-title ">Special title treatment</h5>
<p class="card-text ">With supporting text below as a natural lead-in to additional content.</p>
<center>
<a class="github-ref ">
<i class="fa-brands fa-github fa-2x "></i>
</a>
</center>
</div>
<div class="card-footer text-muted text-center ">
2 days ago
</div>
</div>
</div>
</div>
</div>
<!-- #Projects-2-->
<div class="carousel-item ">
</div>
<!-- #Projects-3-->
<div class="carousel-item ">
</div>
</div>
<button class="carousel-control-prev" type="button " data-bs-target="#projects-carousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon " aria-hidden="true "></span>
<span class="visually-hidden ">Previous</span>
</button>
<button class="carousel-control-next" type="button " data-bs-target="#projects-carousel" data-bs-slide="next">
<span class="carousel-control-next-icon " aria-hidden="true "></span>
<span class="visually-hidden ">Next</span>
</button>
</div>
</div>
</div>
<!-- #footer -->
<footer></footer>
<!-- Scripst-->
<script src="script.js "></script>
<!-- JavaScript Bundle with Popper -->
</body>
adding the css file maybe something is wrong there, it is my first website doing it all alone so kind of messy.
body {
background-image: url("Background.png");
background-repeat: no-repeat;
font-family: 'Arima Madurai', cursive;
background-size: cover;
}
header .carousel-item {
height: 48rem;
background-color: #e6f2ff;
position: relative;
border: 2px;
}
header .first-item {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding-bottom: 50px;
}
.carousel-indicators [data-bs-target] {
background-color: #131acf;
}
.main {
margin: 0;
}
.main>.row {
margin: 10px;
width: 100%;
border-radius: 25px;
}
.card {
box-shadow: 5px -10px rgba(0, 0, 0, 0.2);
margin: 5px;
border: solid 1px #555;
}
.container .col-12 {
background-color: #668cff;
border-radius: 25px;
color: #0033cc;
border: solid 1px #555;
box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.2);
-o-box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.6);
border-radius: 25px;
}
.blockquote-footer {
color: #e6ffff;
font-size: 16px;
}
.section {
height: 46.5rem;
}
.row>figure {
background-color: #6675ff;
margin-top: 20px;
border: solid 1px #555;
box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.2);
-o-box-shadow: 10px -10px 5px rgba(0, 0, 0, 0.6);
border-radius: 25px;
}
header .col-3 {
border-radius: 25px;
margin: 10px;
height: 45rem;
text-align: center;
background-color: #e6e5e5;
}
.section .card {
box-shadow: none;
}
.section .col-4>.card::before {
content: "";
position: absolute;
height: 40%;
width: 100%;
background-color: #0033cc;
}
.section .col-4 .card>img {
border-radius: 50%;
/* width: 10.5vw;
height: 10.5vw; */
align-self: center;
border: solid 3px blue;
z-index: 100;
margin-top: 10px;
}
.fa-brands {
cursor: pointer;
}
.carousel-item .card {
height: 450px;
margin-left: -25%;
margin-top: 45px;
width: 500px;
}
.carousel-item .card .card-img {
display: none;
}
#media screen and (max-width:790px) {
.carousel-item img {
display: none;
}
.carousel-item .card {
height: 520px;
align-self: center;
margin-top: 0;
margin-left: 0;
}
.carousel-item .card .card-body {
align-self: center;
}
.carousel-item .card .card-body {
align-self: center;
}
.carousel-item .card .card-img {
display: block;
}
.card .card-header {
display: none;
}
}
#media screen and (min-width:790px) and (max-width:990px) {
.carousel-item .card {
height: 320px;
align-self: center;
margin-top: -120px;
margin-left: 0;
}
.carousel-item .card .card-body {
align-self: center;
}
.carousel-item .card .card-body {
align-self: center;
}
}
carousel-control-next {
color: black
}

How to create bubble or infobox left side of input type text

I am trying to get that Password meter to the left side in the info box which a triangle tip..
.container {
width: 50%;
}
.infobox {
position: absolute;
}
<div class="container">
<input type ="text" placeholder="password">
<div class="infobox">
Password meter<br>
Uppercase<br>
Special Character<br>
</div>
</div>
You have work with css selector & css pseudo
.container {
width: 50%;
position: relative;
padding-left:240px;
}
.infobox {
position: absolute;
left: 0;
top: 0;
width: 200px;
height: 100px;
border: 1px solid #000;
background:#fff;
z-index: 1;
padding: 10px;
}
.infobox:after {
content: " ";
position: absolute;
right: -15px;
top: -1px;
border-top: 15px solid transparent;
border-right: none;
border-left: 15px solid black;
border-bottom: 15px solid transparent;
}
<div class="container">
<input type ="text" placeholder="password">
<div class="infobox">
<div class="arrow-right"></div>
Password meter<br>
Uppercase<br>
Special Character<br>
</div>
</div>
this what you are looking for!
you can check this codepen for better result.
.side-back{
height:100vh;
width:100%;
background:url("https://picsum.photos/1400") no-repeat center center;
background-size:cover;
}
.form-container{
width:100%;
height:100vh;
display:flex;
align-items:center;
justify-content:center;
}
.suggestion{
width:350px;
background-color:white;
top:-20px;
display:none;
left:-120%;
}
.bar {
height:7px;
}
input:focus + .suggestion{
display:block;
}
.suggestion:after, .suggestion:before {
left: 100%;
top: 20%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
}
.suggestion:after {
border-color: rgba(0, 0, 0, 0);
border-left-color: white;
border-width: 10px;
margin-top: -10px;
}
.suggestion:before {
border-color: rgba(108, 117, 125, 0);
border-left-color: #6c757d;
border-width: 11px;
margin-top: -11px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row m-0">
<div class='col-12 p-0'>
<div class="form-container">
<form class="w-50">
<h1 class="mb-4">Sign In</h1>
<div class="form-group ">
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
</div>
<div class="form-group position-relative">
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
<div class="suggestion p-4 border border-secondary shadow-sm position-absolute">
<p class="mb-1"><b>Password strength:</b><span class="text-success">Good</span></p>
<div class="w-100 bg-light"><div class="w-75 bg-success bar"></div></div>
<p class="m-0 mt-1">Password must be at least 8 Characters! At least one Uppercase Character and one Special Character</p>
<div>
</div>
</div>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Remember me</label>
</div>
Forgot password?
</div>
<button type="submit" class="btn btn-primary w-100 mt-4">Sign In</button>
<p class="mt-2">no account? Sign Up</p>
</form>
</div>
</div>
</div>

How do i align items in a list to look like a chat

Vue chat application
I'm creating this chat app like a little project, but I can't make the messages align properly. The messages sent by the user (light blue) should be on the right side, the CSS looks like:
.received {
text-align: left;
background-color: #0A2472;
margin: 1%;
color: white;
padding: 1%;
max-width: fit-content;
}
.sent {
text-align: right;
align-content: right;
background-color: #A6E1FA;
margin: 1%;
padding: 1%;
max-width: fit-content;
}
It looks fine, until "max-width: fit-content" is added to the style.
Any solutions or other approaches?
The main problem is that your messages are only as wide as their text, so the alignment doesn't matter.
I made a container to hold them. I like CSS Grid for laying out almost everything. The chat messages are just rows in the grid, some justified left and some right.
.chatboard {
display: grid;
width: 100%;
grid-gap: 0.6rem;
max-width: 40rem;
}
.sent,
.received {
padding: 1%;
min-width: 20rem;
border-radius: 0.6rem;
}
.received {
justify-self: left;
background-color: #0A2472;
color: white;
}
.sent {
text-align: right;
justify-self: right;
align-content: right;
background-color: #A6E1FA;
}
<div class="chatboard">
<div class="received">Hi there</div>
<div class="sent">Hello there</div>
<div class="received">Hi there</div>
<div class="sent">Hello there</div>
<div class="received">Hi there</div>
<div class="sent">Hello there</div>
</div>
I have an example of how you can achieve this. I will paste the code below. Look in the css for the specific style you want. It looks like the style rules would be the style modifying the <p> tag in the example the specific css rules modifying it are
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
here is the html
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" type="text/css" rel="stylesheet"
</head>
<body>
<div class="container">
<h3 class=" text-center">Messaging</h3>
<div class="messaging">
<div class="inbox_msg">
<div class="inbox_people">
<div class="headind_srch">
<div class="recent_heading">
<h4>Recent</h4>
</div>
<div class="srch_bar">
<div class="stylish-input-group">
<input type="text" class="search-bar" placeholder="Search" >
<span class="input-group-addon">
<button type="button"> <i class="fa fa-search" aria-hidden="true"></i> </button>
</span> </div>
</div>
</div>
<div class="inbox_chat">
<div class="chat_list active_chat">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
<div class="chat_list">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
<div class="chat_list">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
<div class="chat_list">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
<div class="chat_list">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
<div class="chat_list">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
<div class="chat_list">
<div class="chat_people">
<div class="chat_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="chat_ib">
<h5>Sunil Rajput <span class="chat_date">Dec 25</span></h5>
<p>Test, which is a new approach to have all solutions
astrology under one roof.</p>
</div>
</div>
</div>
</div>
</div>
<div class="mesgs">
<div class="msg_history">
<div class="incoming_msg">
<div class="incoming_msg_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="received_msg">
<div class="received_withd_msg">
<p>Test which is a new approach to have all
solutions</p>
<span class="time_date"> 11:01 AM | June 9</span></div>
</div>
</div>
<div class="outgoing_msg">
<div class="sent_msg">
<p>Test which is a new approach to have all
solutions</p>
<span class="time_date"> 11:01 AM | June 9</span> </div>
</div>
<div class="incoming_msg">
<div class="incoming_msg_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="received_msg">
<div class="received_withd_msg">
<p>Test, which is a new approach to have</p>
<span class="time_date"> 11:01 AM | Yesterday</span></div>
</div>
</div>
<div class="outgoing_msg">
<div class="sent_msg">
<p>Apollo University, Delhi, India Test</p>
<span class="time_date"> 11:01 AM | Today</span> </div>
</div>
<div class="incoming_msg">
<div class="incoming_msg_img"> <img src="https://ptetutorials.com/images/user-profile.png" alt="sunil"> </div>
<div class="received_msg">
<div class="received_withd_msg">
<p>We work directly with our designers and suppliers,
and sell direct to you, which means quality, exclusive
products, at a price anyone can afford.</p>
<span class="time_date"> 11:01 AM | Today</span></div>
</div>
</div>
</div>
<div class="type_msg">
<div class="input_msg_write">
<input type="text" class="write_msg" placeholder="Type a message" />
<button class="msg_send_btn" type="button"><i class="fa fa-paper-plane-o" aria-hidden="true"></i></button>
</div>
</div>
</div>
</div>
<p class="text-center top_spac"> Design by <a target="_blank" href="#">Sunil Rajput</a></p>
here is the css
.container{max-width:1170px; margin:auto;}
img{ max-width:100%;}
.inbox_people {
background: #f8f8f8 none repeat scroll 0 0;
float: left;
overflow: hidden;
width: 40%; border-right:1px solid #c4c4c4;
}
.inbox_msg {
border: 1px solid #c4c4c4;
clear: both;
overflow: hidden;
}
.top_spac{ margin: 20px 0 0;}
.recent_heading {float: left; width:40%;}
.srch_bar {
display: inline-block;
text-align: right;
width: 60%; padding:
}
.headind_srch{ padding:10px 29px 10px 20px; overflow:hidden; border-bottom:1px solid #c4c4c4;}
.recent_heading h4 {
color: #05728f;
font-size: 21px;
margin: auto;
}
.srch_bar input{ border:1px solid #cdcdcd; border-width:0 0 1px 0; width:80%; padding:2px 0 4px 6px; background:none;}
.srch_bar .input-group-addon button {
background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
border: medium none;
padding: 0;
color: #707070;
font-size: 18px;
}
.srch_bar .input-group-addon { margin: 0 0 0 -27px;}
.chat_ib h5{ font-size:15px; color:#464646; margin:0 0 8px 0;}
.chat_ib h5 span{ font-size:13px; float:right;}
.chat_ib p{ font-size:14px; color:#989898; margin:auto}
.chat_img {
float: left;
width: 11%;
}
.chat_ib {
float: left;
padding: 0 0 0 15px;
width: 88%;
}
.chat_people{ overflow:hidden; clear:both;}
.chat_list {
border-bottom: 1px solid #c4c4c4;
margin: 0;
padding: 18px 16px 10px;
}
.inbox_chat { height: 550px; overflow-y: scroll;}
.active_chat{ background:#ebebeb;}
.incoming_msg_img {
display: inline-block;
width: 6%;
}
.received_msg {
display: inline-block;
padding: 0 0 0 10px;
vertical-align: top;
width: 92%;
}
.received_withd_msg p {
background: #ebebeb none repeat scroll 0 0;
border-radius: 3px;
color: #646464;
font-size: 14px;
margin: 0;
padding: 5px 10px 5px 12px;
width: 100%;
}
.time_date {
color: #747474;
display: block;
font-size: 12px;
margin: 8px 0 0;
}
.received_withd_msg { width: 57%;}
.mesgs {
float: left;
padding: 30px 15px 0 25px;
width: 60%;
}
.sent_msg p {
background: #05728f none repeat scroll 0 0;
border-radius: 3px;
font-size: 14px;
margin: 0; color:#fff;
padding: 5px 10px 5px 12px;
width:100%;
}
.outgoing_msg{ overflow:hidden; margin:26px 0 26px;}
.sent_msg {
float: right;
width: 46%;
}
.input_msg_write input {
background: rgba(0, 0, 0, 0) none repeat scroll 0 0;
border: medium none;
color: #4c4c4c;
font-size: 15px;
min-height: 48px;
width: 100%;
}
.type_msg {border-top: 1px solid #c4c4c4;position: relative;}
.msg_send_btn {
background: #05728f none repeat scroll 0 0;
border: medium none;
border-radius: 50%;
color: #fff;
cursor: pointer;
font-size: 17px;
height: 33px;
position: absolute;
right: 0;
top: 11px;
width: 33px;
}
.messaging { padding: 0 0 50px 0;}
.msg_history {
height: 516px;
overflow-y: auto;
}

Align button to bottom of div in desktop and left of div in mobile

I am trying to align the button to the bottom of this div (so the bottom is flush with the bottom of textarea).
Codepen
I was able to do this by adding the following class to button:
.btn-bottom {
position: absolute;
top: 130px;
}
Unfortunately, doing so made the button disappear entirely on mobile:
How can I make the button align with the bottom of the textarea on desktop and with the left edge of the textarea on mobile?
<div class="padding">
<div class="container">
<div class="row">
<h3 class="text-center">Contact Us</h3>
<h5 class="text-center title-lighter">Our team will respond within 48 hours.</h5>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-4">
<label for="inputname">Name</label>
<input type="text" class="form-control" id="inputname">
</div>
<div class="col-md-4">
<label for="email">E-mail</label>
<input type="text" class="form-control" id="email">
</div>
<div class="col-md-4">
<label for="organization">Organization</label>
<input type="text" class="form-control" id="organization">
</div>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-8">
<label for="message">Message</label>
<textarea class="form-control input-lg" style="min-width: 100%;" rows="5" id="message"></textarea>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
<hr />
</div>
You could set the columns of the elements containing the textarea and the button to be display: inline-block (you would have to set float: none for this to work) and then use vertical-align: bottom to align the elements to the bottom of the line that they're siting on.
I also added a class of .row--mod to the row of the element containing the textarea and the button to help target the elements.
.row--mod .col-md-8.col-md-offset-2 > * {
float: none;
display: inline-block;
vertical-align: bottom;
}
.row--mod .col-md-8.col-md-offset-2> :first-child {
margin-right: -4px;
width: 66.6667%;
}
Using inline-block creates extra spacing which you can get rid using a number of methods (I've opted for a negative margin).
See below for a demo:
body {
font-size: 12px !important;
font-family: 'Roboto Condensed', sans-serif !important;
font-weight: 400 !important;
}
.title-lighter {
font-family: 'Roboto', Arial, Helvetica, sans-serif;
color: #737373;
}
.centering {
float: none;
margin: 0 auto;
}
.btn-centering {
width: 90% !important;
margin-left: 5% !important;
margin-bottom: 5px !important;
}
.padding {
padding: 80px 0;
}
.contact-form {
background: #fff;
margin-top: 10%;
margin-bottom: 5%;
width: 70%;
}
.contact-form .form-control {
border-radius: 1rem;
}
.contact-form form {
padding: 14%;
}
.contact-form form .row {
margin-bottom: -7%;
}
.contact-form h3 {
margin-bottom: 8%;
margin-top: -10%;
text-align: center;
color: #0062cc;
}
.contact-form .btnContact {
width: 50%;
border: none;
border-radius: 1rem;
padding: 1.5%;
background: #dc3545;
font-weight: 600;
color: #fff;
cursor: pointer;
}
.btnContactSubmit {
width: 50%;
border-radius: 1rem;
padding: 1.5%;
color: #fff;
background-color: #0062cc;
border: none;
cursor: pointer;
}
.centered-row {
text-align: center;
}
.btn-bottom {
display: table-cell;
vertical-align: bottom;
}
.box {
display: table !important;
width: 100%;
height: 100%;
}
#media (min-width: 992px)
{
.row--mod .col-md-8.col-md-offset-2 > * {
float: none;
display: inline-block;
vertical-align: bottom;
}
.row--mod .col-md-8.col-md-offset-2> :first-child {
margin-right: -4px;
width: 66.6667%;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="padding">
<div class="container">
<div class="row">
<h3 class="text-center">Contact Us</h3>
<h5 class="text-center title-lighter">Our team will respond within 48 hours.</h5>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-4">
<label for="inputname">Name</label>
<input type="text" class="form-control" id="inputname">
</div>
<div class="col-md-4">
<label for="email">E-mail</label>
<input type="text" class="form-control" id="email">
</div>
<div class="col-md-4">
<label for="organization">Organization</label>
<input type="text" class="form-control" id="organization">
</div>
</div>
</div>
<div class="row row--mod">
<div class="col-md-8 col-md-offset-2">
<div class="col-md-8">
<label for="message">Message</label>
<textarea class="form-control input-lg" style="min-width: 100%;" rows="5" id="message"></textarea>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</div>
<hr />
</div>

Bootstrap Responsive container gets height cropped

I am quite new to Bootstrap. I tried to create a boostrap slider that contains on the left side a container with a logo, some text and on the right side a login form. Unfortunately my code is not working properley and my logo and the html form gets cropped once the browsers has a reduced resolution shrinks.
Here is my code: https://jsfiddle.net/bebetxx/z7w2bbso/3/
my CSS
.blue-container
{
color: white;
background-color:#3C8DBC;
}
.blue-container h2,p
{
color: #D2D6DE;
}
.black-container
{
background-color: #2D2D2D;
}
.black-container h2,p
{
color: #BBBBBB;
}
.image-container
{
background: url("http://www.hogash-demos.com/ammon_html/images/sliders/full-slider/slide4.jpg") no-repeat center center scroll;
background-size: cover;
min-height: 350px;
height: 350px;
overflow: hidden;
}
/*SLIDER HEADER
============================================================*/
.slider {
background: url("http://www.hogash-demos.com/ammon_html/images/sliders/full-slider/slide4.jpg")no-repeat center center scroll;
background-size: cover;
min-height: 450px;
height: 300px;
overflow: hidden;
}
.slider-wrap{
padding: 10px 0px;
}
.slider-img{}
.slider-img img{
width: 300px;
height: 500px;
}
.slider{}
.slider-content{
padding-top: 80px;
}
.slider h1 {
margin: 0 0 20px 0;
font-size: 50px;
color: #fff;
text-transform: uppercase;
line-height: 60px;
font-weight: 700;
}
.slider h2 {
font-family: 'lora', serif;
font-style: normal;
color: #fff;
text-transform: capitalize;
font-size: 27px;
text-shadow: 2px 5px 4px #000000;
}
.slider p {
margin-bottom: 25px;
color: #fff;
}
.top-link {
margin-top: 60px;
}
.top-link a{
padding: 20px 30px;
border-radius: 3px;
background: #fff;
font-weight: 700;
-webkit-transition: all .3s linear 0s;
-o-transition: all .3s linear 0s;
transition: all .3s linear 0s;
}
.top-link a i{
color: #00AEFF;
font-size: 25px;
margin-right: 10px;
}
.top-link a:hover{
background: #00AEFF;
color: #fff;
}
.top-link a:hover i{
color: #fff;
}
.logo-slider {
position:relative;
width: 100% !important;
background-size:cover;
padding-bottom: 35%;
background-repeat: no-repeat;
background-size: auto;
max-width: 100%;
}
<!-- Main content -->
<!-- slider section -->
<section class="slider">
<div class="slider-wrap" >
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-1 "><div class="logo-slider" style="background-image:url(http://design.ubuntu.com/wp-content/uploads/ubuntu-logo32.png)"></div><h2>Connect, discover & change the world</h2><ul class="top-link list-inline"><li><i class="fa fa-android"></i> Register</li></ul></div><a name="loginbox"></a>
<div id="loginbox" style="margin-top:10px;" class="col-md-4 col-md-offset-0 col-sm-8 col-sm-offset-2">
<div class="panel panel-info" >
<div class="panel-heading">
<div class="panel-title">Sign In</div>
<div style="float:right; font-size: 80%; position: relative; top:-10px">Forgot password?</div>
</div>
<div style="padding-top:30px" class="panel-body" >
<div style="display:none" id="login-alert" class="alert alert-danger col-sm-12"></div>
<form id="loginform" class="form-horizontal" action="http://127.0.0.1/login#Login" role="form" method="post">
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input id="login-username" type="text" class="form-control" name="username" value="" placeholder="username or email">
</div>
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input id="login-password" type="password" class="form-control" name="password" placeholder="password">
</div>
<input type="hidden" name="val" value="checkin">
<div class="input-group">
<div class="checkbox">
<label>
<input id="login-remember" type="checkbox" name="remember" value="1"> Remember me
</label>
</div>
</div>
<div style="margin-top:10px" class="form-group">
<!-- Button -->
<div class="col-sm-12 controls">
<input type="submit" value="Login" class="btn btn-success">
<a id="btn-fblogin" href="#" class="btn btn-primary">Login with Facebook</a>
</div>
</div>
<div class="form-group">
<div class="col-md-12 control">
<div style="border-top: 1px solid#888; padding-top:15px; font-size:85%" >
Don't have an account?
<a href="http://127.0.0.1/#Registration" <!--onClick="$('#loginbox').hide(); $('#signupbox').show()" -->
<strong>Sign Up Now</strong>
</a>
</div>
</div>
</div>
</form>
</div>
</div> </div>
</div>
</div> <!-- row end -->
</div> <!-- container end -->
</section>
<section id="counter-area" class="blue-container">
<div class="container">
<div class="row">
<div class="heading-inner text-center">
<h2 class="sec-title">Register to <span style="color:white !important"><?php if (isset($g_sWebsiteName)) echo $g_sWebsiteName ?> </span> </h2>
<p><strong>Register right away to this amazing community</strong></p>
<?php
$this->view('registration_box');
?>
</div>
</div> <!-- heading row end -->
</div> <!-- container end -->
</section>
thanks to #Skelly the 2nd problem was that the main slider has a height:300px limit.
The 1st problem was solved using a instead of the div logo used

Resources