Put text and form next to photo using bootstrap - html

This is my HTML:
<div class="row trolibelanja">
<div class="col-md-3">
<img src="http://2.bp.blogspot.com/-WGiyrP7xGOk/VQlHwjgporI/AAAAAAAABHI/zLGXTH0-H2w/s1600/Mie%2BAyam%2B(4).jpg" class="detailfoto">
</div>
<div class="col-md-4">
<p class="detailnama">Mie Ayam Bakso</p>
<p class="detailtoko">Toko Bu Lastri</p>
</div>
<div class="col-md-2">
<p class="detailharga">Rp. 30.000</p>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-btn">
<button class="btnjumlah" type="button">-</button>
</span>
<input type="text" class="form-control jumlah" value="1">
<span class="input-group-btn">
<button class="btnjumlah" type="button">+</button>
</span>
</div>
</div>
<div class="col-md-1">
</div>
</div>
This is my css:
body{
background-color: #661f61 !important;
font-family: 'Saira Extra Condensed', sans-serif !important;
}
.container-fluid.keranjang {
background-color: #e9e9e9;
flex: 1;
}
.container.keranjang {
}
.row.trolibelanja {
background-color: #e1e1e1;
position: relative;
padding-top: 10px;
padding-bottom: 23px;
}
.row.trolibelanja:after{
background-image: -webkit-linear-gradient(135deg, #6e1c64 25%, #e27f31 25%) !important;
position: absolute;
content: " ";
width: 100%;
height: 15px;
bottom: 0;
}
.detailfoto {
width: 100%;
height: 110px;
border: 6px solid white;
}
.detailnama{
font-size: 20px;
font-weight: bold;
}
.detailtoko{
line-height: 20px;
margin: -17px 0px;
}
.detailharga{
font-size: 20px;
font-weight: bold;
text-align: center;
}
.input-group .jumlah {
width: 50%;
text-align: center;
}
.input-group .btnjumlah {
background-color: #e27f31;
color: white;
border: 0;
font-size: 20px;
font-weight: bold;
padding: 0px 10px;
height: 100%;
}
I am trying to put text and form next to photo using bootstrap, as in photo below:
enter image description here
My code result:
enter image description here
Please let me know what am I missing? I tried each combination of display that i know, but they wouldn't work. Thank you

Arrange your columns properly. And you will be good. put image in one column (col-md-3 in this case) and rest of the content in another (col-md-9), then put all rest of the content in a new row. I would suggest that you have a better understanding of the rows and columns from bootstrap website.
https://www.w3schools.com/bootstrap/bootstrap_grid_system.asp
<div class="row trolibelanja">
<div class="col-md-3">
<img src="http://2.bp.blogspot.com/-WGiyrP7xGOk/VQlHwjgporI/AAAAAAAABHI/zLGXTH0-H2w/s1600/Mie%2BAyam%2B(4).jpg" class="detailfoto">
</div>
<div class="col-md-9">
<div class="row">
<div class="col-md-4">
<p class="detailnama">Mie Ayam Bakso</p>
<p class="detailtoko">Toko Bu Lastri</p>
</div>
<div class="col-md-2">
<p class="detailharga">Rp. 30.000</p>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-btn">
<button class="btnjumlah" type="button">-</button>
</span>
<input type="text" class="form-control jumlah" value="1">
<span class="input-group-btn">
<button class="btnjumlah" type="button">+</button>
</span>
</div>
</div>
</div>
</div>
</div>

Add flex-wrap: nowrap; to your .row.trolibelanja like this:
.row.trolibelanja {
background-color: #e1e1e1;
position: relative;
padding-top: 10px;
padding-bottom: 23px;
flex-wrap: nowrap;
}
I made codepen example with your code: https://codepen.io/anon/pen/wPZoXX

i ran your code on bootsnipp and found everything is placed side by side to each other, except for the fact that you did not add img-responsive to the image class. and that the below code is distorting your design.
.row.trolibelanja:after{
background-image: -webkit-linear-gradient(135deg, #6e1c64 25%, #e27f31 25%) !important;
position: absolute;
content: " ";
width: 100%;
height: 15px;
bottom: 0;
}
dont you what you intent designing with that, but i think you need to run a check that css code .
when i added your css to it, it distort the whole code.
first review your CSS is well written , targeting the right class.
second add img-responsive to the img class and i think you are good
to go.

Related

How to blur in CSS only one layer of when you have multiple layers in background-image?

I have a circle image that contains multiple image-background 's - an image and a gradient.
I would like to blur only the image and keep the edges of the circle sharp. I use this image a few times in my HTML code and would like to use different levels of blur in each image - Like the example below.
I tried multiple solutions online, but neither of the solutions I found fits to circle edges.
Link to Codepen
img {
width: 1.2em;
height: 1.2em;
padding: 0.3em;
border-radius: 50%;
border: 1px solid #000000;
background-image: radial-gradient(#aac0e8, #b9cde5, #dce6f2);
margin: 0%;
}
.
<div id="natoTarget" class="infoContainer">
<div class="infoTitle">
<img id="imgNatoTarget" src="img\nato.svg" alt="Nato Target">
<label id="labelNatoTarget">NatoTarget</label>
<label id="labelNatoTargetSize">(2.3 x 2.3)</label>
</div>
<div class="parameterContainer">
<div id="natoDetection" class="parameterLine">
<img id="iconNatoDetection" class="svgBlur" src="img\nato.svg" alt="Nato Detection">
<label id="labelNatoDetection" for="inputDetection">Detection: </label>
<output id="inputNatoDetection" name="outputParameter">33</output>
</div>
</div>
<div class="parameterContainer">
<div id="natoRecognition" class="parameterLine">
<img id="iconNatoRecognition" src="img\nato.svg" alt="Nato Recognition">
<label id="labelNatoRecognition" for="inputRecognition">Recognition: </label>
<output id="inputNatoRecognition">33</output>
</div>
</div>
<div class="parameterContainer">
<div id="natoIdentification" class="parameterLine">
<img id="iconNatoIdentification" src="img\nato.svg" alt="Nato Identification">
<label id="labeNatolIdentification" for="inputNatoIdentification">Identification: </label>
<output id="inputNatoIdentification">33</output>
</div>
</div>
</div>
Example:
.
You have to wrap your image inside a container and blur the image inside it and remove borders from image.
<div class="blurContainer">
<img id="iconNatoRecognition" src="/someimage/path.jpg" alt="Nato Recognition">
</div>
CSS:
.parameterContainer .blurContainer {
display: inline-block;
border: 1px solid #000;
border-radius: 50%;
width: 30.78px;
height: 30.78px;
filter: blur(100);
overflow: hidden;
}
.parameterContainer .blurContainer img {
filter: blur(2px);
}
Hope that solves your issue: fiddle: https://jsfiddle.net/r6v9g5un/
You could put the img in a separate div with a border, then apply filter:blur(1px) to the img
HTML:
<div class="infoTitle">
<div class="circleBorder">
<img id="imgNatoTarget" src="img\nato.svg" alt="Nato Target">
</div>
<label id="labelNatoTarget">NatoTarget</label>
<label id="labelNatoTargetSize">(2.3 x 2.3)</label>
</div>
CSS:
.circleBorder{
border: 2px solid #000000
}
img {
width: 1.2em;
height: 1.2em;
padding: 0.3em;
border-radius: 50%;
border: 1px solid #000000;
background-image: radial-gradient(#aac0e8, #b9cde5, #dce6f2);
margin: 0%;
filter: blur(4px);
}
You need to create a wrapper with background over the image and add a filter property to the image:
It would look like this:
HTML
<div class="parameterContainer">
<div id="natoDetection" class="parameterLine">
<div class="imageBackground">
<img id="iconNatoDetection" class="svgBlur" src="img\nato.svg" alt="Nato Detection">
</div>
<label id="labelNatoDetection" for="inputDetection">Detection: </label>
<output id="inputNatoDetection" name="outputParameter">33</output>
</div>
</div>
CSS
.imageBackground {
width: 1.2em;
height: 1.2em;
padding: 0.3em;
border-radius: 50%;
border: 1px solid #000000;
background-image: radial-gradient(#aac0e8, #b9cde5, #dce6f2);
display: inline-block;
}
.svgBlur {
filter: blur(1px);
}
img {
/*Do nothing*/
}

Is it possible to have button text in two lines with different fonts using HTML and CSS?

Using the attribute value in HTML, I can't make button text work in two lines as well as different font sizes
I have already tried whitespace in css but it's more like word wrap and that does not solve my problem. I also tried using ampersand-hash13; and ampersand-hash10; but it doesn't work as well.
#media (min-height: 280px) {
.divNumKeypad {
position: fixed;
bottom: 0;
width: 100%;
}
.numberBtn{
font-size: 30px;
height: 68px;
}
<div class="col-xs-4 ">
<input id="btnEight" type="button" tabindex="-1" value="HI HELLO" class="btn btn-primary btn-block numberBtn" onclick="buttonClick(8)" />
</div>
I expect to have a button with two lines of text. "HI" should be on the first line with bigger font and the bottom text "HELLO" should be smaller than the text on the top.
Try this below
#media (min-height: 280px) {
.line-1, {
display:block;
font-size: 20px
}
.line-2 {
display: block;
font-size: 10px;
}
}
<div class="col-xs-4 ">
<button>
<span class="line-1">HI</span>
<span class="line-2">HELLO</span>
</button>
</div>
Consider using button instead of input:
button {
font-size: 30px;
}
<button>HI<br><small>HELLO</small></button>
Try this.
label{
max-width: 150px;
font-size: 18px;
display: block;
padding:10px 20px;
border:1px solid black;
cursor: pointer;
}
label span{
display: block;
font-size: 14px;
}
label input{
background:none;
border:none;
}
input[value]{
font-size: 0;
display: none;
}
<div class="col-xs-4 ">
<label> <input id="btnEight" type="button" tabindex="-1" value="HI HELLO" class="btn btn-primary btn-block numberBtn" onclick="buttonClick(8)" />HI<span> HELLO</span></label>
</div>

Style does not affect input in Ionic 3

I am trying create a login page for my app. But style does not work as I wish, here is the photo from problem
1
Here is the login.html codes
<ion-content class="app-content padding main-bg text-center">
<div class="logo animated pulse infinite">
<img src="../../assets/imgs/logo1.png" />
</div>
<form class="app-form">
<div class="list list-inset">
<label class="item item-input sec-main-text">
<input type="text" class="text-center" placeholder="username">
</label>
<label class="item item-input sec-main-text">
<input type="password" class="text-center" placeholder="Password">
</label>
</div>
<button class="button button-block button-clear main-btn main-bg-color" ng-click="goto('/app/home')">Login</button>
Register
<p class="forget" ng-click="forget_password()">Forget Password?</p>
</form>
</ion-content>
Here is the login.scss codes
.app-form .list-inset {
margin-left: 0;
margin-right: 0;
background: none;
}
.app-form {
.item-input {
margin-bottom: 20px;
background: none;
border: 1px solid;
border-radius: 30px;
padding: 5px 10px;
}
.list-inset .item {
border-radius: 30px;
height: 46px;
&.item-input input {
padding: 0;
color: white;
}
}
input {
&::-webkit-input-placeholder, &:-moz-placeholder {
color: white;
text-transform: capitalize;
}
}
}
.app-form .item-select {
select {
width: 100%;
max-width: 100%;
background: none;
text-align-last: center;
padding: 0;
text-align: -moz-center;
text-align: -webkit-center;
text-align-last: -moz-center;
text-align-last: -webkit-center;
direction: ltr;
}
&:after {
top: 60%;
right: 55px;
}
}
And here is the what I want from original login.html :)
2
And from original html's browser screenshot
3
And from my app's browser screenshot
4
Thanks for your helping :)
EDIT
After change html tags with ion tags
Ionic introduces and uses their own tags, for example, which has default styles added to it. It seems that you are using standard tags in your app such as and . Change your input to something like
<ion-item>
<ion-label>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
and things shall work smoother.
Ionic is fun to learn because it is easy. Have a visit the Official Doc to see how you can make things easier. With the proper syntax, you will not less styling rules.

How to add a backdrop over a div (lightbox effect)?

i'm editing an AngularJS project and i want to add a backdrop (like Bootstrap Modal) over the main DIV when users click on search input box.
Here is the HTML code:
<div class="main-box">
<div class="search-function" ng-click="showInputForm()">
<img src="../images/my_project/search.png">
</div>
<div class="search-form" ng-if="showForm">
<form ng-submit="textSearch()">
<input type="text" autofocus class="search-input" ng-model="text.value" />
</form>
</div>
</div>
As you can see the white box appears when users click on the search icon and now i want to add a backdrop over the main DIV, except on the white box.
Here is the LESS code:
.search-function {
margin-left: 30%;
}
.search-form {
padding-left: 15%;
padding-right: 15%;
position: relative;
z-index: 0;
.search-input {
color: #2b84a6 !important;
background-color: #fff !important;
font-weight: 300;
font-size: 16px;
}
}
How can i reach this?
Something like this
<div class="main-box">
<div class="backdrop" ng-if="showForm"></div>
<div class="search-function" ng-click="showInputForm()">
<img src="../images/my_project/search.png">
</div>
<div class="search-form" ng-if="showForm">
<form ng-submit="textSearch()">
<input type="text" autofocus class="search-input" ng-model="text.value" />
</form>
</div>
</div>
And add the CSS as
.backdrop {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: black;
opacity: 0.5;
}
Here's a very complete article about different methods of achieving what you need
CSS Overlay Techniques

Border at bottom of parallax website

Im having trouble getting rid of the border at the bottom of my website, www.goodlord.co. It is a single page scroller.
The last image is the problem I need to extend it to the end of the whole website but each time i do that the website its self extends. I would really appreciate any help.
Tom
This is the Style Sheet for the section css.
section{ background: #fff; }
body{ -webkit-font-smoothing: antialiased; #fefefe; }
#main-container{ overflow: hidden; }
input{ -webkit-appearance: none; }
input:focus{ outline: none; }
.nopad{ padding: 0px; }
.offix{ overflow: hidden; }
.pad-normal{ padding-top: 66px; padding-bottom: 34px; }
.pad-large{ padding-top: 60px; padding-bottom: 60px; }
.pad-end{ padding-top: 60px; padding-bottom: 60px; }
.pad-large-top{ padding-top: 99px; }
.pad-large-bottom{ padding-bottom: 99px; }
.pad-top{ padding-top: 66px; }
.pad-bottom{ padding-bottom: 66px; }
.space-top{ margin-top: 22px; }
.space-top-large{ margin-top: 44px; }
::selection {color:#fff;background:#444444;}
::-moz-selection {color:#fff;background:#444444;}
This is the index for the section.
<a id="contact-scroll"></a>
<section id="contact" class="text-divider bg-cover pad-end">
<img alt="Slider Background" class="divider-bg" src="img/estate.jpg" />
<div class="divider-overlay"></div>
<div class="row divider-content">
</div>
<div class="row divider-content">
<div class="medium-8 medium-centered columns">
<form id="contact-form" class="text-center">
<h1 class="text-white">Get in touch</h1>
<input id="form-name" type="text" placeholder="Name" />
<input id="form-email" type="text" placeholder="Email" />
<input id="form-msg" type="text" placeholder="Message" />
<div class="text-right">
<span id="details-error" class="text-white">*Error: Please complete all fields correctly</span>
<span id="form-sent" class="text-white">Thankyou, your enquiry has been sent!</span>
<div class="btn white-btn clear-btn"><h6 class="alt-h text-white">Clear</h6></div>
<div id="form-btn" class="btn white-btn"><h6 class="alt-h text-white">Send</h6></div>
</div>
</form>
</div>
</div>
Having a look, that last white border is actually padding, not border.
the final section with ID '#work' has the '.pad-large' class on it. remove it and the final image should butt up right to the bottom of the page.
You might need to restore the top padding of the item, as .pad-large adds 60px padding to the top and bottom of the item.