Grouped buttons don't fit the full width - html

<div data-role="header" id="commonHead">
<div data-role="navbar">
<h3 id="pageHeaderH1" alt="my root way to home" style="text-align:center;">myRWTH</h3>
<div data-role="controlgroup" data-type="horizontal">
Yes
No
Maybe
</div>
</div>
</div>
This is my code but the buttons don't fit the content width, but are aligned to the left. I don't see why I wouldn't work. Any ideas?
UPDATE: I don't know why, but it wouldm't work. my workaround is the following
<div data-role="header" id="commonHead" data-theme="b" >
<div data-role="navbar" data-iconpos="right">
<h3 id="pageHeaderH1" alt="my root way to home" style="text-align:center;" data-mini="true">myRWTH</h3>
<ul>
<li>Anzeigeoptionen
<div data-role="popup" id="popupBasic" data-theme="b">
<a id="ownPosition" data-role="button" data-icon="home" data-inline="true">Eigene Position</a>
<a id="ownPosition" data-role="button" data-icon="minus" data-inline="true">Mensen</a>
<a id="ownPosition" data-role="button" data-icon="minus" data-inline="true">HSP</a>
<a id="ownPosition" data-role="button" data-icon="minus" data-inline="true">Gebäude</a>
<a id="ownPosition" data-role="button" data-icon="minus" data-inline="true">Haltestellen</a>
<a id="ownPosition" data-icon="delete" data-icon="home" data-inline="true">Alle ausblenden</a>
</div>
</li>
</ul>
</div>
</div>

You might need to tweak it and it's a hack at that:
http://jsfiddle.net/kewRs/
JS:
// override the jQM CSS
var cbnb = $('#customButtonNavbar');
var numberOfButtons = ($('.customButton').length > 0) ? $('.customButton').length:1;
var widthOfButtons = (Math.round(100 / numberOfButtons));
cbnb.children('.ui-controlgroup-controls').attr('style', 'width:100%;');
cbnb.children().children().attr('style', 'width:'+widthOfButtons+'%;');
HTML:
<div data-role="header" id="commonHead">
<div data-role="navbar">
<h3 id="pageHeaderH1" alt="my root way to home" style="text-align:center;">myRWTH</h3>
<div data-role="controlgroup" data-type="horizontal" id="customButtonNavbar">
Yes
No
Maybe
</div>
</div>
</div>​

Many ways of doing this, here's one:
<div data-role="header" id="commonHead">
<div data-role="navbar">
<h3 id="pageHeaderH1" alt="my root way to home" style="text-align:center;">myRWTH</h3>
<div data-role="controlgroup" data-type="horizontal">
<div style="width: 33%; float: left; text-align: center">
Yes
</div>
<div style="width: 33%; float: left; text-align: center">
No
</div>
<div style="width: 33%; float: left; text-align: center">
Maybe
</div>
</div>
</div>
</div> ​

try adding data-type="horizontal" to the buttons individually. Manual
<div data-role="header" id="commonHead">
<div data-role="navbar">
<h3 id="pageHeaderH1" alt="my root way to home" style="text-align:center;">myRWTH</h3>
<div data-role="controlgroup" >
Yes
No
Maybe
</div>
</div>

Related

Element div not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)

I am trying to find a solution to this validation error.
I am pretty new to coding, any help would be great.
<div style="padding-top: 0px; overflow: hidden;">
<ul class="ui-listview">
<li class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-li-has-thumb ui-btn-hover-a ui-btn-up-a ui-li-has-count ui-li-count">
<div class="ui-btn-inner ui-li ">
<div class="ui-btn-text"> <a class="ui-link-inherit" href="/link/?id=1234"> <span class="lady img" style="float: left;"> <img class="ui-li-thumb" style="border: 0px;" src="https://images.test.com/images/inserat/img/01k.jpg" alt="Inserat" title="Inserat" /> </span>
<p class="ui-li-desc"><strong>City</strong></p>
<p class="ui-li-desc">Street</p>
<h4 class="ui-li-heading">Name</h4>
<p class="ui-li-desc">Text, Text, ...</p>
</a> </div>
<span class="ui-icon ui-icon-arrow-r ui-icon-shadow"> </span> </div>
</li>
</ul>
<div class="clear"></div>
</div>

Bootstrap css Aligns the text to the center by the text length of the other div

I want to use css, bootstrap to align the first line align left, and the second line will center on the text length of the first line.
I tried many ways but not.
code follow
<div class="col-md-6">
<a href="/" style="text-decoration:none">
<div class="col-md-12 row-eq-height" style="padding:0;">
<div class="col-md-2" style="padding:0">
<img src="/Content/images/logo.png" class="img-responsive" alt="">
</div>
<div class="col-md-10 tex-center" style="padding-right:0;">
<div style="padding:0">
<div class="line1-bold">THIS IS THE FIRST LONG HEADLINE</div>
<div class="line2">THIS IS THE SECOND HEADLINE</div>
</div>
</div>
</div>
</a>
</div>
Please check this..
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<div class="col-md-6">
<a href="/" style="text-decoration:none">
<div class="col-md-12 row-eq-height" style="padding:0;">
<div class="col-xs-2" style="padding:0">
<img src="https://www.tenforums.com/attachments/browsers-email/18558d1485951187t-microsoft-edge-logo-microsoft-edge-100582336-large.png" class="img-responsive" style="width:100px" alt="">
</div>
<div class="" style="float:left;">
<div class="line1-bold" style="color:#b63957; font-size:18px;">THIS IS THE FIRST LONG HEADLINE</div>
<div class="line2" style="color:#b63957; font-size:16px; text-align:center;">THIS IS THE SECOND HEADLINE</div>
</div>
</div>
</a>
</div>
Try adding the class text-center to your divs.
Here is a working pen.
Something like this?
I don't know about your task, but I deleted some tags.
CSS
.img-responsive {
width: 100px;
float: left;
}
span {
display: block;
}
HTML
<div class="col-md-6">
<a href="/" style="text-decoration:none">
<div class="col-md-12 row-eq-height" style="padding:0;">
<img src="https://www.tenforums.com/attachments/browsers-email/18558d1485951187t-microsoft-edge-logo-microsoft-edge-100582336-large.png" class="img-responsive" alt="">
<span class="text-left">THIS IS THE FIRST LONG HEADLINE</span>
<span class="text-center">THIS IS THE SECOND HEADLINE</span>
</div>
</a>
</div>
Reference Link

How to vertically align divs with different contents?

I have two section on a page. I am not able to vertically align their contents. I am using vertical-align:middle yet unable to do it. I have also tried display:flex but that creates problem in responsive view.
Here is the structure:
<div class="container-fluid" style="display:table;width:100%;">
<div class="row" style="display: table-cell;vertical-align:middle;">
<div class="col-lg-9 section_1">
<div class="logo hidden-xs">
<img src="custom_images/logo.png" />
</div>
<div class="realtor">
<img src="custom_images/realtors-profileimg.png" width="70" height="70" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
<div class="moving_companies hidden-xs">Find Moving Companies in Chicago, IL 1-8444-4Move-EZ</div>
<div class="phone_number hidden-xs">080-888-0888</div>
<<div class="powered_by hidden-xs">
<img src="custom_images/powerdby-logo.png" />
</div>
</div>
<div class="col-lg-3 section_2" style="height:70px;">
<!--<button class="login">Login<i class="fa fa-caret"></i></button>-->
<div class="logo">
<img src="custom_images/logo.png" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
</div>
</div>
</div>
and the style is here....
.row > div
{
display: table-cell;
vertical-align: middle;
}
.section_1 > div
{
display: inline-block;
}
.section_2 > div
{
display: inline-block;
}
img
{
max-width: 100%;
max-height: 100%;
}
and here is the screen shot of the problem...
You had error in HTML <<div class="powered_by hidden-xs">
Here is fixed version https://jsfiddle.net/kjp91hko/2/
<div class="container-fluid" style="display:table;width:100%;">
<div class="row" style="display: table-cell;vertical-align:middle;">
<div class="col-lg-9 section_1">
<div class="logo hidden-xs">
<img src="custom_images/logo.png" />
</div>
<div class="realtor">
<img src="custom_images/realtors-profileimg.png" width="70" height="70" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
<div class="moving_companies hidden-xs">Find Moving Companies in Chicago, IL 1-8444-4Move-EZ</div>
<div class="phone_number hidden-xs">080-888-0888</div>
<div class="powered_by hidden-xs">
<img src="custom_images/powerdby-logo.png" />
</div>
</div>
<div class="col-lg-3 section_2" style="height:70px;">
<!--<button class="login">Login<i class="fa fa-caret"></i></button>-->
<div class="logo">
<img src="custom_images/logo.png" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
</div>
</div>
</div>

Can't move element away from other elements in HTML file?

At the bottom of this page http://kimcolemanprojects.com/cyanotype-hats.html there is a section with the title "Related Projects".
I can't move this title down from the grid of images above. I think there must be an error in the Html structure, but I can't find it. I have given the element padding and margin but it still will not move.
This is a section of the html code from that page:
<div class="container">
<div id="header">
<h1>KIM COLEMAN PROJECTS</h1>
<div id="nav">
<ul>
<li id="work">
Work
</li>
<li id="about">
About</li></ul>
</div><!--end nav-->
</div><!--end header-->
<div class="main-individual">
<!-- grid of Work -->
<a rel="hats" href="images/hats/velour 2.jpg" class="fancybox" data-title-id="title-5">
<div class="view view-sixth">
<img src="images/hats/small-velour 2.jpg" />
<div class="mask">
<div class="mask-text">
<h2>Velour trilby with Cyanotype ribbon</h2>
<p></p>
</div>
</div>
</div></a>
<div id="title-5" class="hidden">
Velour trilby with Cyanotype ribbon</div>
<a rel="hats" href="images/hats/balaclava.jpg" class="fancybox" data-title-id="title-1">
<div class="view view-sixth">
<img src="images/hats/small-balaclava.jpg" />
<div class="mask">
<div class="mask-text">
<h2>Balaclava with Cyanotype ribbon</h2>
<p></p>
</div>
</div>
</div></a>
<div id="title-1" class="hidden">
Balaclava with Cyanotype ribbon.
</div>
<span class="similar"><h6>Related Projects</h6></span>
<a href="unique.html" >
<div class="view-small view-sixth-small">
<img src="images/related-project-images/uniques.jpg" />
<div class="mask-small">
<div class="mask-text">
<h2>Unique</h2>
</div>
</div>
</div></a>
<a target="blank" href="http://kimcolemanjennyhogarth.co.uk/glare.htm" >
<div class="view-small view-sixth-small">
<img src="images/related-project-images/glare.png" />
<div class="mask-small">
<div class="mask-text">
<h2>Glare</h2>
</div>
</div>
</div></a>
<a target="blank" href="http://kimcolemanjennyhogarth.co.uk/act_natural.htm" >
<div class="view-small view-sixth-small">
<img src="images/related-project-images/act-natural-glare.png" />
<div class="mask-small">
<div class="mask-text">
<h2>Act Natural Glare</h2>
</div>
</div>
</div></a>
</div>
</div>
You could reduce the margin in the .view-small class, e.g. to margin: 20px 2%. Is this what you meant?
Update: Try to set the line-height: 30px; in .similar class. This moves the title down to the small images.

jQuery Mobile navigation bug

I have problem with jQuery Mobile. In jQuery Mobile to go to another page of site, I just need to add id of page block. But in the following code jQuery Mobile don't work, when i'm clicking on the list items. Here is my code:
<div id="all" data-role="page" data-url="all" tabindex="0" class="ui-page ui-page-theme-a ui-page-active" style="min-height: 642px;">
<div data-role="header" role="banner" class="ui-header ui-bar-inherit">
<a href="#home" data-role="button" data-icon="arrow-l" data-rel="back" class="ui-link ui-btn-left ui-btn ui-icon-arrow-l ui-btn-icon-left ui-shadow ui-corner-all" role="button">
Back
</a>
<h1 class="ui-title" role="heading" aria-level="1">All Notes</h1>
</div>
<div data-role="content" class="ui-content" role="main">
<ul data-role="listview" id="all_notes" class="ui-listview"><li class="ui-first-child">
Boris
</li><li>
Note
</li><li class="ui-last-child">
eferf
</li></ul>
</div>
</div>
<div id="note-detail-list"><div data-role="page" id="note_afed16af-9fea-03fc-9315-5ca1f690b665" data-url="note_afed16af-9fea-03fc-9315-5ca1f690b665">
<div data-role="header">
<a href="#home" data-role="button" data-icon="arrow-l" data-rel="back">
Back
</a>
<h1>Boris</h1>
</div>
<div data-role="content">
The best
</div>
</div><div data-role="page" id="note_eb0cd69c-d571-7d1e-6e83-2f8d681b3f95" data-url="note_eb0cd69c-d571-7d1e-6e83-2f8d681b3f95">
<div data-role="header">
<a href="#home" data-role="button" data-icon="arrow-l" data-rel="back">
Back
</a>
<h1>Note</h1>
</div>
<div data-role="content">
gjfth
</div>
</div><div data-role="page" id="note_3dd66e0d-fb7a-5a3a-ab80-6237c70d742a" data-url="note_3dd66e0d-fb7a-5a3a-ab80-6237c70d742a">
<div data-role="header">
<a href="#home" data-role="button" data-icon="arrow-l" data-rel="back">
Back
</a>
<h1>eferf</h1>
</div>
<div data-role="content">
freferf
</div>
</div></div>
DEMO
There is a problem in the markup, so jquery mobile is not rendering correctly:
<div id="note-detail-list">
is out of all pages.
If you remove it everything works. Try:
http://jsfiddle.net/7M5c5/3/