I'm having a problem with the input-group on my site not sizing down for xs screen sizes.
Here's the code:
<div class="gradient">
<div class="container">
<div class="row">
<div class="col-xs-1 col-s-1 col-m-2"></div><!-- /left column -->
<div class="col-xs-10 col-s-10 col-m-8">
<h1>IS IT ON NETFLIX?</h1>
<p>Search to see if your TV show or movie is available to stream on Netflix</p>
<div class="input-group searchbox">
<input type="text" id="searchInput" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button id="submit" class="btn btn-default" type="button">Go!
</button>
</span>
</div><!-- /input-group -->
</div><!-- /middle column -->
<div class="col-xs-1 col-s-1 col-m-2"></div><!-- /right column -->
</div><!-- /row -->
</div><!-- /container -->
</div><!-- /gradient -->
The site is isitonnetflix.net. Thanks so much!!
Wrapping the image tag with an aligned div:
<div class="" align="center"></div>
could help with it being able to sit in the middle of the div, but you could also:
<img src="" align="middle" alt="">
you could definitely change those values and it might be kind of gross to do that, but it might help.
Figured it out. Changed width on the searchbox class to 80%. Fixed!
You can also facilitate bootstraps media queries in a way that .searchbox is defined as:
.searchbox {
border-radius: 5px;
height: 50px;
margin: 0 auto;
padding-top: 20px;
/* width: 300px; */
}
without stating its width explicitly for Xtra Small sizes you'll see it fixes too. Another solution would be to set max-width instead of width:
.searchbox {
border-radius: 5px;
height: 50px;
margin: 0 auto;
padding-top: 20px;
max-width: 300px;
}
Related
I've read 5-6 question / answers but can't find what I'm looking for _
Bootstrap 4 columns aren't behaving the way I expect them to. Below about 600px device width the edge overflows instead of continuing to reduce in size
at 618px the columns are still reducing
at 538px the columns are overflowing
HTML:
<div class="container">
<div class="row">
<div class="col-lg-9 col-md-12">
<div class="outerDivBorder" id="photoBox">
<div style="height: 10em;"></div>
</div><!-- /#photoBox -->
</div>
<div class="col-lg-3 col-md-12">
<div class="outerDivBorder" id="dataBox">
<div style="height: 10em;"></div>
</div><!-- /#dataBox -->
</div>
</div>
</div><!-- /.container -->
CSS:
.outerDivBorder {
width: 100%;
border: 1px solid #454343;
padding: 0 1rem;
margin: 1rem;
margin-top: 1.5rem;
margin-bottom: 2rem;
}
Thanks in advance for any guidance offered on this : )
You put margin: 1rem; on .outerDivBorder, and that margin pushes content out on small screens. Use padding on cols instead - it can be done by using utility class for padding, py-3 in this case:
.outerDivBorder {
width: 100%;
border: 1px solid #454343;
padding: 0 1rem;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-lg-9 col-md-12 py-3">
<div class="outerDivBorder" id="photoBox">
<div style="height: 10em;"></div>
</div>
</div>
<div class="col-lg-3 col-md-12 py-3">
<div class="outerDivBorder" id="dataBox">
<div style="height: 10em;"></div>
</div>
</div>
</div>
</div>
Had a similar problem. On mine it was happening because of
* {
box-sizing: inherit;
}
Bootstrap already reset that to border-box and the col's and row's behave according to that.
I'm having trouble figuring out why my jumbotron container is covering the entire page. I am trying to have the jumbotron stop right before "Find your university".
Second, I am also having trouble with moving the search bar to the middle of the jumbotron. Can anyone help? I'm new to HTML, CSS and Bootstrap.
HTML:
<div class="center jumbotron">
<div class="container">
<h1>MOVE ABROAD WITH EASE</h1>
<h2>Find out about the cities, where to live and eat, hangout groups.</h2>
<div class="container">
<div class="row">
<div id="custom-search-input">
<div class="input-group col-md-6">
<input type="text" class=" search-query form-control" placeholder="Which city are you moving to?" />
<span class="input-group-btn">
<button class="btn btn-danger" type="button">
<span class=" glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
CSS:
.center {
text-align: center;
}
#custom-search-input {
margin: 0;
margin-top: 50px;
margin-bottom: 50px;
padding: 10;
}
Your jumbotron is likely filling your page because you have all your content inside of it. Just move everything from Find Your University and below out of it.
As for centering your input, Bootstrap provides the col-xx-offset-# concept to help with this.
Here's a Fiddle with your code updated to illustrate.
Some additional notes and pointers:
padding: 10; is invalid css (possibly just a typo). make sure to include px if that was your intention.
Creating your own .center class is unnecessary. Bootstrap comes with a .text-center class for this purpose.
My Jumbotrons background image isn't quite making it full width.
Any idea why?
Live link: http://185.123.96.102/~kidsdrum/moneynest.co.uk/
You can see the the width of the background image doesn't make it as far as the nav bar.
HTML
<div class="container special">
<div class="jumbotron">
<div class="container text-center">
<div class="h1extrapadding hidden-xs hidden-sm"></div> <h1 class="boldme">Aged 20-30 & frustrated with money?</h1>
<div class="greenpromobox">
<div class="h2extrapadding hidden-xs hidden-sm"></div> <h2 class="boldme">Take our free <b class="jumpstarttext">Jumpstart Your Finances</b> class to<br /> quickly gain control over your finances</h2>
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup">
<form action="//moneynest.us11.list-manage.com/subscribe/post?u=9ccf2d2219536b32eaae3c3d1&id=299de51b4e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<img src="http://185.123.96.102/~kidsdrum/moneynest.co.uk/img/hand-drawn-arrow.png" id="handarrow" class="hidden-xs hidden-sm" alt="arrow"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="Enter your email address" required autofocus>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_9ccf2d2219536b32eaae3c3d1_299de51b4e" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Start Class Now" name="subscribe" id="mc-embedded-subscribe" class="text-uppercase btn btn-primary btn-lg"></div>
</div>
</form>
</div>
<!--End mc_embed_signup-->
</div>
</div>
</div>
</div>
</div>
CSS
.jumbotron {
background-image: url("../img/checking-finances-in-cafe-blurred.png");
background-size: cover;
color: white;
}
#handarrow {
position: relative;
top: -50px;
left: -5px;
}
html,body {height:100%;}
.special,.special .jumbotron
{height:100%;
width: 100%;
}
I think your problem might be the default margin or padding on the html and body tags. Try:
html, body {
margin: 0px;
padding: 0px;
}
Not sure if that will work, but it's worth a shot.
The reason for this is bootstrap's container class, that takes up padding on both the left and right hand side. If you remove this class, the image will take up the full screen.
Or, you can use the container-fluid class
Bootstrap requires a containing element to wrap site contents and house our grid system. You may choose one of two containers to use in your projects. Note that, due to padding and more, neither container is nestable.
Use .container for a responsive fixed width container.
Use .container-fluid for a full width container, spanning the entire width of your viewport.
I tested it out in Chrome's Developer tools, and that fixed it.
it is due to you have added class container remove this class from first div it will resolve you issue.
<div class="container special"> to <div class="special">
I am having some issues trying to display my <div checkoutoptionsto the right and my <div productdetailsto the left of checkoutoptions
Here is how it is displaying now:
Here is how I would like it to display
It looks like there is some kind of wrapping around the div checkoutoptionsthat won't let me move the div productdetails upbut I have not idea how to correct the issue.
Here is a link to my website as an example if you would like to see it first hand.
Here is my HTML:
<!-- Share and title/show this panel on top -->
<div class="ProductMain" style= "float: left; ">
<h1 itemprop="name">%%GLOBAL_ProductName%%</h1>
%%GLOBAL_FacebookLikeButtonAbove%%
%%GLOBAL_FacebookLikeButtonBelow%%
%%GLOBAL_PinterestButton%%
<!--side panel with add to cart show this panel to the right-->
<div id="checkoutoptions">
%%SNIPPET_ProductAddToCartRight%%
<div><input id="ShopButton" style="display: none";></div>
%%SNIPPET_ProductAddToCartBelow%%
%%Panel.SideProductAddToWishList%%
<div class="WishlistRow DetailRow" style="display:%%GLOBAL_HideWishlist%%">
<a class="WishListButton" href="javascript: void(0)">ADD TO WISHLIST</a>
</div>
%%GLOBAL_AddThisLink%%
</div>
<!--Yotpo Reviews/ display this panel next to checkoutoptions to the left and right under ProductMain-->
<div id="productdetails">
<div style="padding: 0px 0px 0px; width: 200px; margin: auto; height: 00px"> </div><!--yotpo product rating-->
<div class="yotpo bottomLine"
data-product-id="%%GLOBAL_ProductId%%"
data-url="%%GLOBAL_ProductLink%%">
</div>
<div class="ProductDetailsGrid">
<div class="DetailRow RetailPrice" style="display: %%GLOBAL_HideRRP%%">
<span class="Label">%%LNG_RRP%%:</span>
%%GLOBAL_RetailPrice%%
%%GLOBAL_YouSave%%
</div>
</div>
Here is my CSS so far:
#checkoutoptions{
margin:auto;
padding: 10px;
border-radius: 5px;
width: 310px;
border: 1px solid gray;
}
Switch place on the div with review and the div with product info. Result will be like
<div class="yotpo bottomLine yotpo-medium" data-product-id="705" data-url="" data-yotpo-element-id="2">
..... content
</div>
<div class="ProductDetailsGrid">
....content
</div>
should instead be rearranged to
<div class="ProductDetailsGrid">
....content
</div>
<div class="yotpo bottomLine yotpo-medium" data-product-id="705" data-url="" data-yotpo-element-id="2">
..... content
</div>
Doesn't look exactly like you wished for, but I believe it's quite good.
Actually the order/structure of elements is not good. You should restructure your html and create small containers for each section.
For example.
<div class="post-meta">
<div class="share-box">
<div class="share-buttons"><!-- fb and pinterest buttons --></div>
<div class="product-price-rating"><!-- item price, rating etc --></div>
</div>
<div class="cart-box">
<!-- cart and other code -->
</div>
<div class="clearfix"></div>
</div>
Now you can easily achieve the layout you want by floating each box and clearing float before closing parent.
.share-box{
float: left;
}
.cart-box{
float: right;
}
.clearfix{
clear: both;
}
Add to your css class:
display: inline-block;
Within the structure below what is the best way to be able to align the div#logo into the middle of the grid_12 visible div for only non mobile devices.
Can I create a custom piece of code to override the above classes?
I have created a Plunker with my code - http://plnkr.co/edit/lrRm0nXdYaz5g7dYe4DS
HTML:
<header class="row visible">
<div class="grid_12 visible">
<div class="row logo-wrap">
<!-- logo -->
<div class="grid_6">
<div id="logo">
<img src="http://dev.jzm.co.nz/mytime/image/data/logo-black-web.png" title="My Time Candles" alt="My Time Candles" />
</div>
</div>
<!-- search -->
<div class="grid_6 visible">
<div id="search">
<div class="button-search">Search</div>
<input type="text" name="filter_name" value="Search ... " onclick="this.value = '';" onkeydown="this.style.color = '#000000';" />
</div><!--/search-->
</div>
</div><!--/row-->
</div><!--/grid_12-->
</header><!--End Header-->
Give the div with the id of logo a width and set its margin-left and margin-right css properties to auto.. also setting a max-width to 100% will ensure the responsive behaviour..
#logo{
width: 100%;
max-width: 300px; /* Original width of the logo image */
margin-left: auto;
margin-right: auto;
text-align: center;
float: left;
}
and i hope you have already done this but..
#logo img{
max-width: 100%;
height: auto;
}
UPDATE:
Modify your markup like so
<div id="container-top">
<div id="logo">
<img src="http://dev.jzm.co.nz/mytime/image/data/logo-black-web.png" title="My Time Candles" alt="My Time Candles">
</div>
<!-- search -->
<div id="search" class="visible">
<div class="button-search">Search</div>
<input type="text" name="filter_name" value="Search ... " onclick="this.value = '';" onkeydown="this.style.color = '#000000';">
</div>
<!--/search-->
</div>
#container-top{
position: relative;
}
#search{
top: 15%;
right: 0;
}
But then you'll have to use media queries to adjust your #search css as layout changes..
Also i have made some CSS changes above (before update section)..
Only you have to write one line margin: 0 auto;
#logo
{
margin:0 auto;
}