How to create alert message with media-object behaviour? - html

I want to create alert info message with media-object behaviour.
I mean this behaviour:
There is image on the left side of the alert and text on the another side.
What I've tried?
I am getting this:
With such code:
<div class="alert alert-info">
<div class="media">
<span class="pull-left glyphicon glyphicon-exclamation-sign"></span>
<div class="media-body">
<p>string1</p><p>string2</p><p>string3</p>
</div>
</div>
</div>
But glyphicon is too small. I need bigger glyphicon here. How I can make icon bigger or what approach should I use?

This is as far as I could get:
http://jsfiddle.net/9Sx62/
Basically, I wrapped icon with .media-object div, the docs says that it shouldn't be mixed with other components. Then, I increased font-size so icon would be bigger

This helped:
<div class="media">
<span class="pull-left lg glyphicon glyphicon-info-sign"></span>
<div class="media-body">
<p>Статус договора <em>действует</em> означает, что Вы можете сделать заказ на поставку у данного поставщика.</p>
<p>В таблице встречаются строки разных цветов. Зеленый цвет означает, что договор действующий, а серый — срок действия истек.</p>
</div>
</div>
Also, class .lg specified in css:
.lg {
font-size: 1.5em;
}

Related

How to increase font size in bootstrap

I need to increase following telephone number font size.
<div class="topbar">
<div class="container">
<div class="row">
<div class="col-md-12">
<p class="pull-left hidden-xs"><i class="fa fa-clock-o"></i><span>Mon - Sat 8.30AM - 5.00PM. Sunday CLOSED</span></p>
<p class="pull-right"><i class="fa fa-phone"></i>Tel No. (+77) 853 740 966</p>
</div>
</div>
</div>
</div>
Wrap it in span and add css to it:
.text-large {
font-size: 150%;
}
<div class="topbar">
<div class="container">
<div class="row">
<div class="col-md-12">
<p class="pull-left hidden-xs"><i class="fa fa-clock-o"></i><span>Mon - Sat 8.30AM - 5.00PM. Sunday CLOSED</span></p>
<p class="pull-right text-large"><i class="fa fa-phone"></i><span>Tel No. (+77) 853 740 966</span></p>
</div>
</div>
</div>
</div>
Update: <big> is supposed to be deprecated in HTML5, so CSS is the only way. Using a relative size works best no matter what the current font size is.
.font-size-lg { font-size: 1.2rem; }
I haven't found an easy way with Bootstrap, so I use <big>.
<p class="pull-right">
<big><i class="fa fa-phone"></i>Tel No. (+77) 853 740 966</big>
</p>
I wish there was a Bootstrap class so I don't have to use an extra line in HAML.
%p
%big This is bigger.
<span style="font-size:30px">Tel No. (+77) 853 740 966</span>
Or
.large-fontsize{
font-size: 30px !important;
}
<span class="large-fontsize">Tel No. (+77) 853 740 966</span>
If you are using SCSS of similar to generate your CSS, you can add your own global class that slightly increases (+25%) the font size.
In the _variables.scss found in the Bootstrap bundle there is a variable already defined $font-size-lg. Use it to define a class in your own style.scss (or similar) in your project.
.font-size-lg {
font-size: $font-size-lg;
}
Use it in HTML
<span class="font-size-lg">Text to enlarge</span>
You can always bypass bootstrap and edit the font size at the source in-line:
style="font-size:x-large;"

How to fix display position to desired value in CSS3 using bootstrap?

I am trying to achieve the icon shown below, using combination of 2 bootstrap icons:
I tried giving margin\top\right. None of it seem to have any effect.
This is what I have tried so far: jsfiddle
Code:
<div class="row pull-right" style="margin-right: 50px; margin-top: 10px;">
<div id="toggleIcon">
<div class="eye">
<span class="glyphicon glyphicon-eye-open adjust-eye"></span>
</div>
<span class="glyphicon glyphicon-align-justify"></span>
</div>
</div>
SCSS: (in fiddle)
Kindly let me know how can that be achieved and also why isn't margin\top\right working as expected?
#toggleIcon .eye{position: relative; bottom:-20px;}

html - href in accordion header not working

I have an accordion with links in the header. It is in such a way that the accordion can be opened when clicked anywhere on the header. Because of this when clicked on the link, instead of going to that link (href) the accordion is opened.
Desired behaviour:
I want the accodion to be opened when clicked anywhere in the header except the link. (i.e when clicked on the link, the user must be redirected and accordion must not be opened)
<div>
<accordion close-others="false">
<accordion-group is-open="isopen" ng-repeat="ele in arr">
<accordion-heading>
<div>
<i class="pull-right glyphicon"
ng-class="{'glyphicon-chevron-down': isopen, 'glyphicon-chevron-right': !isopen}"></i>
<div style="width: 50%; float: left; padding-left: 6cm;">{{ele.a}}
<span >
link
</span>
</div>
<div style="text-align: center;">
<span>{{ele.b}}</span>
</div>
</div>
</accordion-heading>
</accordion-group>
</accordion>
</div>
Plnkr
You need to call $event.stopPropagation(); in your ng-click -> ng-click="$event.stopPropagation(); fn1();"
The trick is to call Event.stopPropagation() inside ng-click handler of anchor:
link
Here's an updated plunker.
use
ng-click="$event.stopPropagation()"//this will not apply accordion click event on this link tag
instead of
ng-click="fn1()"
This Might not work on plunk try it in your code.
When using accordion-heading, everything in it will be turned into an <a> tag.
Your code will be rendered in brower
<h4 class="panel-title">
<a class="accordion-toggle ng-binding" ng-click="isOpen = !isOpen" accordion-transclude="heading">
<div class="ng-scope">
<i class="pull-right glyphicon glyphicon-chevron-right" ng-class="{'glyphicon-chevron-down': isopen, 'glyphicon-chevron-right': !isopen}"></i>
<div style="width: 50%; float: left; padding-left: 6cm;" class="ng-binding">1
<span>
link
</span>
</div>
<div style="text-align: center;">
<span class="ng-binding">2</span>
</div>
</div>
</a>
</h4>
This is solution https://stackoverflow.com/a/14202514/3901308

There is an awkward spacing in-between span tag

In my code I am using bootstrap and adding words to go with the glyphicons. My words are within the span tag and have this awkwardly large space when it is just a normal space.
<div class="first-draft view">
<h4>First-Draft</h4>
<img src="img/view.png" alt="City View"/>
<h5><span class="glyphicon glyphicon-file"> View Report</span></h5>
<h6><span class="glyphicon glyphicon-unchecked"> Compare</span></h6>
</div>
Here is a jsfiddle example http://jsfiddle.net/zbyztda8/
If any of the solution doesn't work, try removing the font-family. I think the spacing is due to font 'Glyphicons Halflings' . Better way is to have text in separate span without any styling and different span for glyphicon.
HTML:
<div class="first-draft view">
<h4>First-Draft</h4>
<img src="img/view.png" alt="City View" />
<h5><span class="glyphicon glyphicon-file"> View Report</span></h5>
<h6><span class="glyphicon glyphicon-unchecked"> Compare</span></h6>
</div>
<br/>
<div class="first-draft view">
<h4>First-Draft</h4>
<img src="img/view.png" alt="City View" />
<h5><span class="glyphicon glyphicon-file"></span><span>View Report</span></h5>
<h6><span class="glyphicon glyphicon-unchecked"> Compare</span></h6>
</div>
Demo: http://jsfiddle.net/zbyztda8/2/
See the last section which doesn't have font-family in span tag.

How to use same header for multiple page inside same html file

I want to make an iPad HTML5/CSS3 based app and I found out about JQuery Mobile and tried to use it. Here what it looks like :
This is the summary page, when a user clicks on one of the grid element it should go to the proper detail page. (Click on grid "a" should go to an inner page with id "blockA" etc...).
I encoutered some problems and cannot find any clear clues on the net.
I want my header + photo and summary + "informations" bar to be fixed. The only solution I found is to copy/paste the header div into my "blockA" page and into the 5 others which I found really annoying. Basically I want my top screen to be fixed and my bottom screen to change on link navigation. I thought of using jquery append methods and such but is there any "native" way of doing so?
My header was really hard to bring like you can see it on the picture. I had to change the CSS a bit. Is there any easier way? Some class I missed in the JQuery structure CSS maybe? Can't find any exhaustive class list for JQM.
How to set heights for my different components without modifying CSS.
Here is some of my HTML code :
<body>
<div data-role="page" id="page_main" style="min-height: 496px; ">
<div data-role="header" id="nav-header-pleiades" data-add-back-btn="true" data-back-btn-text="Retour à la sélection">
<h1>Dossier de <span class='ptaGetUser' attribute-value='Name'>Mr. XXXXXXX</span></h1>
<ul data-role="listview">
<li class="pta-file-content" data-icon="custom" data-theme="c">
<img class="pta-img-collab" src="img/collab/Pic-S.jpg"/>
<div class="ui-grid-a">
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='title'>Mr.</span> <span class='ptaGetUser' attribute-value='firstname'>Whatever</span> <span class='ptaGetUser' attribute-value='lastname'>X</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='mail'>whatever.x#mail.com</span></p>
</div>
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='birthdate'>09/03/1984</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='phone'>0450090909</span></p>
</div>
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='work_id'>1656486m</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='assignment'>Ingénieur débutant</span></p>
</div>
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='status'>Status</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='building'>Company</span></p>
</div>
<div class="ui-block-a">
<p>Employé depuis <span class='ptaGetUser' attribute-value='employee_since'>01/09/2010</span></p>
</div>
</div>
</li>
</ul>
<h1 class="ui-title">Informations</h1>
</div>
<div class="ui-grid-b">
<div class="ui-block-a">
<span id='ptaGetUserBlockA'>a</span>
</div>
<div class="ui-block-b">
<span id='ptaGetUserBlockB'>b</span>
</div>
<div class="ui-block-c">
<span id='ptaGetUserBlockC'>c</span>
</div>
<div class="ui-block-a">
<span id='ptaGetUserBlockD'>d</span>
</div>
<div class="ui-block-b">
<span id='ptaGetUserBlockE'>e</span>
</div>
<div class="ui-block-c">
<span id='ptaGetUserBlockF'>f</span>
</div>
</div>
</div>
<div data-role="page" data-title="Page Foo" id="blockA">
<div data-role="header" id="nav-header-pleiades" data-add-back-btn="true" data-back-btn-text="Retour à la sélection">
<h1>Dossier de <span class='ptaGetUser' attribute-value='Name'>Mr. XXXXXXX</span></h1>
<ul data-role="listview">
<li class="pta-file-content" data-icon="custom" data-theme="c">
<img class="pta-img-collab" src="img/collab/Pic-S.jpg"/>
<div class="ui-grid-a">
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='title'>Mr.</span> <span class='ptaGetUser' attribute-value='firstname'>Whatever</span> <span class='ptaGetUser' attribute-value='lastname'>X</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='mail'>whatever.x#mail.com</span></p>
</div>
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='birthdate'>09/03/1984</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='phone'>0450090909</span></p>
</div>
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='work_id'>1656486m</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='assignment'>Ingénieur débutant</span></p>
</div>
<div class="ui-block-a">
<p><span class='ptaGetUser' attribute-value='status'>Status</span></p>
</div>
<div class="ui-block-b">
<p><span class='ptaGetUser' attribute-value='building'>Company</span></p>
</div>
<div class="ui-block-a">
<p>Employé depuis <span class='ptaGetUser' attribute-value='employee_since'>01/09/2010</span></p>
</div>
</div>
</li>
</ul>
<h1 class="ui-title">Informations</h1>
</div>
mon bloc A
</div>
</body>
Don't look at the ptaGetUser spans, it's for my later persistence framework that I should work on to add seamless persistence to HTML pages like this. For now though this is just here for nothing. I've also only added the first block for this exemple.
My CSS to make this the right dimension :
.ui-title,.ui-title
{
height:24px;
}
.banner
{
height:45px;
padding: 0px 15px !important;
}
.ui-li-thumb, .ui-li-icon {
max-width:165px;
max-height:165px;
}
.pta-file-content
{
height:148px;
}
.ui-li-has-thumb
{
padding-left: 165px !important;
}
.ui-grid-a
{
padding-top: 5px;
}
.ui-grid-b
{
height:543px;
width: 1022px;
}
.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b,.ui-grid-b .ui-block-c
{
height:50%;
width:32%;
border: 1px solid black;
}
The whole screen slides when I click on the first grid element to show the page. As you can see I've copied the whole header into my second page div which is really bad for code readability. I also have CSS problems with my grid borders as it doesn't show bottom borders, how can I add borders to a grid without modifying CSS?
1) jQuery Mobile doesn't currently offer persistent headers and footers, but an upcoming version, 1.1, will. Whether or not they stay on the page during transitions is something that has not yet been answered. Your best bet is to use some sort of server-side language for your pages, then set the header as an include. That way you don't have to copy and paste across multiple pages.
2) jQuery Mobile is great for building apps, but to get something truly custom, you've got to write it yourself; be that CSS or HTML or both.
3) Only way to achieve custom heights for your elements is to write custom CSS.
It sounds like you are trying to do a lot without modifying CSS. Why is that a requirement of your project?
It sounds like you are looking for a persistent header. Start here with the JQM Footers documentation. They cover persistence and it should be the same for headers. If the JQM docs do not solve this issue, check out this other Stackoverflow post.
If you are looking for a custom configuration, check out the very bottom of this documentation on JQM headers. If that doesn't quite do it you may also try the JQM layout grids. Otherwise, you will need CSS, be it inline or otherwise.
While I am not sure I completely understand the problem here, I have heard that CSS/HTML should be used to control layout width, but not height. Sorry, having trouble finding the articles to back that up so lets just consider that one design philosophy. Just the same, this post tells you how to evenly balance height with CSS.
As for your last question about borders, you would have to use CSS to control them. Whether or not you do it inline or a stylesheet like one created with the JQM Themeroller, I am not aware of any other way of styling borders other than CSS.
Hope this helps!