I'm working on a new project that's mainly based on Twitter Bootstrap. Problem is, I've been trying for days to figure out how to get the cells (from the grid) not to stack themselves on small resolutions.
I'd like instead that the content of my cells resizes itself, so everything is kept on one single row.
I use the .col-md-3 and .col-md-6 classes, here is my code:
<header>
<section id="left" class="col-md-3">
<i class="fa fa-circle greendot"></i>
<span>ALARM: OK</span>
<br/>
<i class="fa fa-circle orangedot"></i>
<span>DETECTION: SENSORS ISSUE</span>
<p id="logintext">
<?php
if(empty($_SESSION['user']))
{
echo('NOT LOGGED IN /// LOG IN');
}
else {
$uppercaseusername = strtoupper(htmlentities($_SESSION['user']['username']));
echo('WELCOME ' . $uppercaseusername . ' /// LOG OUT');
}
?>
</p>
</section>
<section id="banner" class="col-md-6">
<img src="banner.png" alt="FireGuard Main Banner" id="headerlogo" />
</section>
<section id="right" class="col-md-3">
<h3 id="time"></h3>
</section>
</header>
I hope that you understood what my problem is, I can provide screenshots if needed!
Thanks a lot in advance ;)
Ok I think you need to read the docs well before asking this question but let me sum it up for you.
Bootstrap 3+ has three different grids small(sm)- medium(md)- large(lg) each targeting a different screen size with a mobile first approach.
I will give you the solution but to really understand the mechanism of the framework invest sometime in reading it very well.
Change all of the (md) to (sm) and that should work for you, ex: col-md-3 => col-sm-3
Related
I’m using Bootstrap grid incorrectly and I’m can’t for the life of me work it out!
I designed this page so that it would split the image alongside the copy. I thought a simple split col-6 row in “Over 40 years Media Experience” would do it but it looks like the image is over 50%.
I want the image to go the width of the column. I’ve tried img-fluid and img-responsive but nothing is working as well as the HUGE (and inelegant!) workaround (written in the following two containers.
If anyone could take a look and see if I’ve missed anything crashingly obvious. I’d be forever grateful.
<div class="container container-head">
<div class="row">
<div class="col-12">
<h2>Over 40 years’ <span class="spotlight">media experience</span></h2>
</div>
</div>
<div class="row">
<div class="col-6-md media">
<div class="fsm-about-pic image-fluid">
<img src="images/about-joncorrinenew640.jpg"
alt="Jon and Corinne from Full Story Media">
</div>
</div>
<div class="col-6-md media-body">
<p><i class="far fa-circle"></i> Full Story Media is led by us: Jon Card
and Corinne Card. <!-- this could be a subtitle now with bit below as a testimonial like the client quotes -->
</p>
<p><i class="far fa-circle"></i> With over 40 years’ media experience between
us, we have written for every national newspaper in the UK, plus many other titles
worldwide.</p>
<p><i class="far fa-circle"></i> We are entrepreneurial, media savvy and believe
in the power of storytelling.</p>
<p><i class="far fa-circle"></i> We ensure our clients get the best advice. In fact, we
insist on it. </p>
<p><i class="far fa-circle"></i> We are also completely transparent about our
methods and tend to give away all of our knowledge.</p>
</div>
</div>
</section> ```
I am creating a web application in asp.net and I am using bootstrap version 4 for the layout of the site.
I have the following code to include a title on the left hand side (with some additional text) and then the image on the right, however when I resize the screen the image overlaps the "Welcome to the site" before it then eventually stacks the columns.
<div class="container-fluid">
<div class="row portal-intro">
<div class="col-md-4">
<p class="home-header">Welcome to the site</p>
<p>
You can make a variety of applications, reports and requests by using our online forms.
For example you can apply for resident permits, report an issue or you can request a call back.
</p>
</div>
<div class="col-md-8">
<img class="img-fluid" src="~/Content/Images/city.png" />
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301865">Learn more »</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301866">Learn more »</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301867">Learn more »</a></p>
</div>
</div>
</div>
I used img-fluid to see if that was the issue, but it still happens. The image eventually does stack it's just the "in between" size where it overlaps and is fine when the scree is full width.
I haven't added any additional CSS as this is done by the addition of the img-fluid class.
It may be worth adding that I have also tried setting the image to the background of the column and it does the same, suggesting there may be a problem with the column on the left rather than the image.
The problem is that your text is so large that the individual words don't fit the column space you've allotted. Reduce font size in a responsive way and it's all fine. For example:
#media (min-width: 768px) {
.home-header {
font-size: 30px;
}
}
Problem demonstration
Also, you should be using heading tags for headings. Semantic document structure is important.
I'm currently building an application for a Pomodoro Timer, I'm using Bulma as a CSS Framework, and so far I'm loving it, I'm still learning how Flexbox works, I would like to know what would be the best approach to this situation and if it can be done using only Bulma classes or if I would have to create my own.
I'm trying to create "cards" for each task added, but I want them to be just about half or less that the full screen width. I don't understand how to make this happen using Bulma, since everything just takes the full width and I can't just center everything since it doesn't have a hard-coded width. This is my code for the section that contains the task cards.
<div class="section">
<div class="task-container is-center">
<div class="card is-clearfix is-1-touch" style="margin-bottom: 10px" v-for="task in tasks" :key="task.id">
<input type="checkbox" class="checkbox">
<span class="has-text-left">
{{task.desc}}
</span>
<span class="icon is-pulled-right has-text-danger"><i class="far fa-times-circle"></i></span>
<span class="icon is-pulled-right has-text-primary"><i class="far fa-play-circle"></i></span>
</div>
</div>
</div>
Any help, tips, suggestions, etc. Would be greatly appreciated!.
You could use columns classes to achieve what you want
<div class="task-container columns is-multiline">
<div class="card column is-half is-offset-one-quarter">
// statements
</div>
</div>
Here is the link to the official documentation: https://bulma.io/documentation/columns/options/#centering-columns
You could wrap the card div with a columns container and use the is-half class if you don't want to use the offset class.
I'm trying to get these dumb image links in my mobile app to work, I have 3 different ones.. Email, Phone and Website. All fed dynamically. I got them at least able to do something, but it seems to like try to find it within the application itself.. can anyone help me figure out what I'm doing wrong? I'm really new to mobile applications, this is my first shot so it's rather different than everything else i've done.
<div class="row text-center" style="margin-bottom:20px;">
<div class="col">
<a style="display:block;text-decoration:none;" ng-href="tel:{{data.company.phoneNumber}}">
<div class="well bluegrad-Box">
<i class="fa fa-phone white-Icon"></i>
</div>
</a>
</div>
<div class="col">
<a style="display:block;text-decoration:none;" ng-href="mailto:{{data.company.emailAddress}}">
<div class="well orangegrad-Box">
<i class="ion-email white-Icon2"></i>
</div>
</a>
Thank you!!!!
Using font icons I put
<div data-icon="r"> </div>
to have an icon display for example.
Now if I like two or more of the same icon to display next to the first one can I only use multiple divs for that like so
<div data-icon="r"> </div>
<div data-icon="r"> </div>
<div data-icon="r"> </div>
or can one somehow write
<div data-icon="r" "r" "r"> </div>
or
<div data-icon="r,r,r,r"> </div>
or something along those lines?
Naturally all these tests fails so I wonder if this is generally possible in HTML and if so how please?
How about this?
<div>
<i data-icon="r"></i>
<i data-icon="r"></i>
<i data-icon="r"></i>
<i data-icon="r"></i>
</div>
This should create 4 inline icons. Im basing this on how font awesome works.