The word 'City' breaks my layout in Safari only - html

I have discovered what appears to be a very odd behaviour in Safari and I cannot figure out what is going on.
My layout as viewed in Chrome:
But when viewed in Safari I get the following:
For some bizarre reason the <small class="text-muted">(required)</small> portion of my HTML has been dropped to a new line.
Even more bizarrely, if I just change one letter in the word 'City', the layout becomes correct.
The same portion of my form but I have literally changed one thing and that is that I've changed the word 'City' to instead say 'Sity':
In fact, I seem to be able to use any word instead of 'City', but when I use the word 'City', the label suddenly takes up 2 lines. So, in light of this, there is an easy fix which is to just use the word 'Town' instead of the word 'City' but I would still like to know if this is just a really strange bug or if I'm missing something.
What on earth is going on here?
I was unable to recreate this issue in stack overflow's code snippet tool.
I am using Bootstrap 4 and the portion of HTML that I'm looking at is as follows:
<div class="form-row">
<div class="form-group needs-validation col-sm-6 col-md-6">
<label for="inputCity">City <small class="text-muted">(required)</small></label>
<input type="text" class="form-control" id="inputCity" name="city" required>
<div class="invalid-feedback">
Please provide your city.
</div>
</div>
<div class="form-group needs-validation col-sm-6 col-md-4">
<label for="inputState">State <small class="text-muted">(required)</small></label>
<input type="text" class="form-control" id="inputState" name="state" required
autocomplete="address-level1">
<div class="invalid-feedback">
Please provide your state.
</div>
</div>
<div class="form-group needs-validation col-5 col-sm-4 col-md-2">
<label for="inputZip">Zip <small class="text-muted">(required)</small></label>
<input type="text" class="form-control" id="inputZip" name="zip" required>
<div class="invalid-feedback">
Please provide your zip code.
</div>
</div>
</div>
EDIT Responding to Comments
#Rdg Replacing the space with does indeed fix the layout. But why does this only occur when followed by the word 'City' and nothing else (granted I haven't tested every word in the English language, so could it be something to do with the exact width of the word 'City'?)
#Geuis Yes I have finally managed to recreate this in codepen, it seems to be an issue with the font I am using ("Raleway") and the exact width of the word "City". https://codepen.io/Redtama/pen/RdRpqX
#Richard Uie I'm not sure what you mean by substitute the HTML entity for uppercase "c," i.e., &#67;, but with regards to the wrapping being caused by width, I can replace the word 'City' with something much longer and no wrapping takes place.
Example with Longer Label Text

I would recommend adding the following to your css forcing the text to become an inline element:
.text-muted {
display: inline-block;
}

Related

Why does linebreak mess up my CSS in one case but not another? (see fiddles)

The only difference between this fiddle and this other version of the fiddle is that the 2nd one has </label><label for="address_zip" class="zip"> without a line break after the closing </label> tag.
<label for="address_state" class="state">
<span>State</span><input name="address_state" type="text" placeholder="CA" required="" class="field is-empty">
</label><label for="address_zip" class="zip">
<span>ZIP</span><input name="address_zip" type="text" placeholder="94107" required="" class="field is-empty">
</label>
I've experienced similar weirdness before. Line breaks are tricky.
So, I figured "I'll live with the fact that the HTML won't have a new line after the closing label tag, even though that looks sloppy."
However, then I noticed that a nearly identical webpage I'd coded (with just different CSS) seems to be immune from this line break problem.
Why?
Your form is basically one long line, since there are no block sections such as div. You added a display: flex to each label, but not to fieldset, so that each label is on its own row.
When you add a break line between your labels, that break line is added to the HTML view as a space, which makes it too long to fit into one row.
Here is how the code should look like:
<div>
<label for="cardholder-name"> Name </label
<input name="cardholder-name" type="text" placeholder="Jenny Rosen" class="question field is-empty personHead">
</div>
You might have to redo some css to align it properly, but this is the proper format.

Bootstrap input field doesn't look right in some cases

I'm quite new here. In this simple bootstrap site, I have an input field with a label in front of it. It looks fine in my browser with default value 1.00, and it's responsive when I resize my browser. However that input filed becomes very small when I accessed the site through some other people's computers. The default value also disappeared. Is there anything wrong with how I defined this field? Many thanks in advance!
<div class="col-lg-4 col-lg-offset-4">
<div class="input-group">
<span class="text-center input-group-addon" id="sizing-addon2">Amount</span>
<input class="form-control" type="text" id="amount" aria-describedby="sizing-addon1" value="1.00">
</div>
</div>

input text isnt responding on iphone

I have a simple form, with simple text inputs something like this:
<form>
<input type="text" name="name"/>
<input type="text" name="number"/>
<textarea name="comments"></textarea>
</form>
Now when I go to the site on an iPhone, when I click into one of the text boxes it doesn't do anything at all.
However when i click on the text area it lets me start typing. So the textarea is working but not the type text input fields.
Yes this does work on a desktop PC.
I don't know why this isn't working?
Your div col-lg-6 col-md-6 (Section 2) is overriding(not the technical term but oh well..), your div col-lg-6 col-md-6 (Section 1). If you give your Section 1 div a height of 450px, you should be able to work from there.
so:
<div class="col-lg-6 col-md-6" style="font-size:1.2em;height: 450px;"><!-- THIS IS THE 1st section -->.....
You should be able to type in your textboxes.

Best way to create row and columns in tab-pane

Im having trouble with creating my form which is placed in a tab-pane. It seems that my labels and input
elements are crossing each others bounderies when labels are to long or the window made smaller
My code can be seen here .. please notice that labels and inputs dont stay aligned when window size changes. It seems like making rows and columns inside tab-pane is not working the same way as when they are created outside that class.
http://www.bootply.com/I3Iwdr4UVj
It's as if the input element does not know the boundry of the label ..
Are there other ways to nicely create the form inside my tab-pane ? ..
First of all, try to give a className with wider width, .col-sm-2 is too narrow for a label:
<div class="form-group">
<label class="control-label col-sm-5" for="pwd">Password:</label>
<div class="col-sm-7">
<input type="password" placeholder="Enter password" id="pwd" class="form-control">
</div>
</div>
I would suggest you always try to get the sum of 12 when you use Bootstrap classes.

Aligning the logo with the input fields on ASP.NET MVC 4 using Bootstrap

Im designing a website using Visual Studio 2012 ASP.NET MVC4
And it’s supposed to be like this
but it turned out to be like this
![default2][2]
I need to align the logo with the Username & Password fields and those fields should have space in between. Btw, I'm using the latest version of Twitter Bootstrap as my CSS. Thanks for helping out!
Also, these are my codes.
<header class="navbar navbar-inverse" role="banner">
<div class="container">
<img src="#Url.Content("~/Content/img/Logo-Sample.png")" alt="Image" id="logo" class="img-responsive"/>
<div class="pull-right">
<form class="navbar-form pull-right" role="form">
<div class="form-group">
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Username">
</div>
<div class="form-group">
<input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox"> Remember me
</label>
</div>
<button type="submit" class="btn btn-default">Sign in</button>
</form>
</div>
</div>
</header>
Update:
I've applied Ryan's suggestion the "float stuff" and the logo is now inlined with the input fields.
But the input field went upward instead of downward. Any suggestions for this? Thanks!
Check out Bootstrap's docs for Inline forms. I believe this is exactly what you are looking for.
As a side note, check out TwitterBootstrapMVC. Your code might look cleaner with it.
So it looks like your logo and login sections are both block-level elements. They need to be inline-block OR one of them needs to be floated left or right as appropriate.
Insofar as the space between elements for your login block... I'd do a css selector to match the header login input elements and add some margin-right to them.
HTML formatting is very finicky sometimes. However, open up the markup for the asp file and put a space between those input areas' tags or put one trailing after the word in the placeholder. For the being slightly too high, I forgot the word I am looking for, but its something a bit like a table, make them both in slots for that row. Look around for what Im attempting to say as I just completely forgot the term.
(if I remember Ill come back and edit this)