Note that there are some explanatory texts on larger screens.

plurals
  1. POStyling Not Displaying As I Intended
    primarykey
    data
    text
    <p>From <a href="https://stackoverflow.com/questions/12519393/having-problems-getting-getting-razor-to-see-my-css">this previous post</a> I have this code:</p> <pre><code>@model SuburbanCustPortal.Models.AddCustomerModel @{ ViewBag.Title = "Add an Existing Account"; } &lt;h2&gt;Add an existing account.&lt;/h2&gt; &lt;p&gt; Use the form below to add an existing account to your web login. &lt;/p&gt; &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt; @using (Html.BeginForm()) { @Html.ValidationSummary(true, "Account not found. Please verify the infomartion below and try again.") &lt;div&gt; &lt;fieldset&gt; &lt;legend&gt;Account Information&lt;/legend&gt; &lt;div&gt; &lt;label class="small-label"&gt;Branch&lt;/label&gt;&lt;label class="large-label"&gt;Account Number&lt;/label&gt; &lt;/div&gt; &lt;br /&gt; &lt;div&gt; @Html.TextBoxFor(m =&gt; m.Branch, new { @class = "small-textbox" }) @Html.TextBoxFor(m =&gt; m.AccountNumber, new { @class = "large-textbox" }) &lt;/div&gt; &lt;div&gt; @Html.ValidationMessageFor(m =&gt; m.Branch) &lt;br /&gt; @Html.ValidationMessageFor(m =&gt; m.AccountNumber) &lt;/div&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;fieldset&gt; &lt;legend&gt;AND&lt;/legend&gt; &lt;div class="editor-label"&gt; @Html.LabelFor(m =&gt; m.LastName) &lt;/div&gt; &lt;div class="editor-field"&gt; @Html.TextBoxFor(m =&gt; m.LastName) @Html.ValidationMessageFor(m =&gt; m.LastName) &lt;/div&gt; &lt;br /&gt; &lt;label class="excited-label"&gt;- OR -&lt;/label&gt; &lt;div class="editor-label"&gt; @Html.LabelFor(m =&gt; m.PhoneNumber) &lt;/div&gt; &lt;div class="editor-field"&gt; @Html.TextBoxFor(m =&gt; m.PhoneNumber) @Html.ValidationMessageFor(m =&gt; m.PhoneNumber) &lt;/div&gt; &lt;/fieldset&gt; &lt;p&gt; &lt;input type="submit" value="Register" /&gt; &lt;/p&gt; &lt;/fieldset&gt; &lt;/div&gt; } </code></pre> <p>Any my css:</p> <pre><code>body { background-color: #5c87b2; font-size: .85em; font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; margin: 0; padding: 0; color: #696969; } a:link { color: #034af3; text-decoration: underline; } a:visited { color: #505abc; } a:hover { color: #1d60ff; text-decoration: none; } a:active { color: #12eb87; } p, ul { margin-bottom: 20px; line-height: 1.6em; } header, footer, nav, section { display: block; } /* HEADINGS ----------------------------------------------------------*/ h1, h2, h3, h4, h5, h6 { font-size: 1.5em; color: #000; } h1 { font-size: 2em; padding-bottom: 0; margin-bottom: 0; } h2 { padding: 0 0 10px 0; } h3 { font-size: 1.2em; } h4 { font-size: 1.1em; } h5, h6 { font-size: 1em; } /* PRIMARY LAYOUT ELEMENTS ----------------------------------------------------------*/ /* you can specify a greater or lesser percentage for the page width. Or, you can specify an exact pixel width. */ .page { width: 90%; margin-left: auto; margin-right: auto; } header, #header { position: relative; margin-bottom: 0px; color: #000; padding: 0; } header h1, #header h1 { font-weight: bold; padding: 5px 0; margin: 0; color: #fff; border: none; line-height: 2em; font-size: 32px !important; text-shadow: 1px 1px 2px #111; } #main { padding: 30px 30px 15px 30px; background-color: #fff; border-radius: 4px 0 0 0; -webkit-border-radius: 4px 0 0 0; -moz-border-radius: 4px 0 0 0; } footer, #footer { background-color: #fff; color: #999; padding: 10px 0; text-align: center; line-height: normal; margin: 0 0 30px 0; font-size: .9em; border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; } /* TAB MENU ----------------------------------------------------------*/ ul#menu { border-bottom: 1px #5C87B2 solid; padding: 0 0 2px; position: relative; margin: 0; text-align: right; } ul#menu li { display: inline; list-style: none; } ul#menu li#greeting { padding: 10px 20px; font-weight: bold; text-decoration: none; line-height: 2.8em; color: #fff; } ul#menu li a { padding: 10px 20px; font-weight: bold; text-decoration: none; line-height: 2.8em; background-color: #e8eef4; color: #034af3; border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; } ul#menu li a:hover { background-color: #fff; text-decoration: none; } ul#menu li a:active { background-color: #a6e2a6; text-decoration: none; } ul#menu li.selected a { background-color: #fff; color: #000; } /* FORM LAYOUT ELEMENTS ----------------------------------------------------------*/ fieldset { border: 1px solid #ddd; padding: 0 1.4em 1.4em 1.4em; margin: 0 0 1.5em 0; } legend { font-size: 1.2em; font-weight: bold; } textarea { min-height: 75px; } input[type="text"], input[type="password"] { border: 1px solid #ccc; padding: 2px; font-size: 1.2em; color: #444; width: 200px; } select { border: 1px solid #ccc; padding: 2px; font-size: 1.2em; color: #444; } input[type="submit"] { font-size: 1.2em; padding: 5px; } /* TABLE ----------------------------------------------------------*/ table { border: solid 1px #e8eef4; border-collapse: collapse; } table td { padding: 5px; border: solid 1px #e8eef4; } table th { padding: 6px 5px; text-align: left; background-color: #e8eef4; border: solid 1px #e8eef4; } /* MISC ----------------------------------------------------------*/ .clear { clear: both; } .error { color: Red; } nav, #menucontainer { margin-top: 40px; } div#title { display: block; float: left; text-align: left; } #logindisplay { font-size: 1.1em; display: block; text-align: right; margin: 10px; color: White; } #logindisplay a:link { color: white; text-decoration: underline; } #logindisplay a:visited { color: white; text-decoration: underline; } #logindisplay a:hover { color: white; text-decoration: none; } /* Styles for validation helpers -----------------------------------------------------------*/ .field-validation-error { color: #ff0000; } .field-validation-valid { display: none; } .input-validation-error { border: 1px solid #ff0000; background-color: #ffeeee; } .validation-summary-errors { font-weight: bold; color: #ff0000; } .validation-summary-valid { display: none; } /* Styles for editor and display helpers ----------------------------------------------------------*/ .display-label, .editor-label { margin: 1em 0 0 0; } .display-field, .editor-field { margin: 0.5em 0 0 0; } .text-box { width: 30em; } .text-box.multi-line { height: 6.5em; } .tri-state { width: 6em; } /* custom created by eric */ .small-label { float: left; width: 50px; margin: 1em 0 0 0; } .small-textbox { float: left; margin: 1em 0 0 0; width: 50px; } .large-label { float: left; margin: 1em 0 0 0; width: 150px; } .large-textbox { float: left; margin: 1em 0 0 0; width: 150px; } .excited-label{ font-weight: bold; padding: 5px 0; margin: 0; color: blue; border: none; font-size: 16px !important; } </code></pre> <p>The css for these lines is not working correctly:</p> <pre><code>@Html.TextBoxFor(m =&gt; m.Branch, new { @class = "small-textbox" }) @Html.TextBoxFor(m =&gt; m.AccountNumber, new { @class = "large-textbox" }) </code></pre> <p>It is not applying the small-textbox or large-textbox.</p> <p>And it is also displaying all on one line even though I use &lt; div> or &lt; p>.</p> <p>Here is what it is showing:</p> <p><img src="https://i.stack.imgur.com/fFJ9U.png" alt="enter image description here"></p> <p>Anyone have any ideas why my form is displaying oddly?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload