Html CSS - Apply style to all elements inside a class? -
I have a strange situation, I have a table, I have AJAX form in every line. I I need to write a CSS that can do all the margins and the padding of all the items within any class. Or is there an easy way to align the content under the headline? To accept the width, add a display: block; For the span css, use of the div instead of form < / Code> is not allowed in
tr , but it is allowed in
td . So I had to keep all the columns inside a
td and manually match the size of bureaucracy. The problem is the padding and margin that combines the HtmlHelpers (ASP.Net MVC Razor), causing the content to not be aligned under the correct header column.
& lt; Table style = "width: 100%" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th style = "width: 5%" & gt; Id & lt; / Th & gt; & Lt; Th style = "width: 35%" & gt; Content & lt; / Th & gt; & Lt; Th style = "width: 60%" & gt; Details & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; @forchange (model in model item) {& lt; Tr & gt; & Lt; Td square = "no margin endpadding" colspan = "3" & gt; @using (@Azax.getfinform ()) {& lt; Span style = "width: 5%" & gt; @html TextboxFor (I = & gt; Item ID) & lt; / Span & gt; & Lt; Span style = "width: 35%" & gt; @ Html.TextBoxFor (i = & gt; item names) & lt; / Span & gt; & Lt; Span style = "width: 60%" & gt; @ Html.TextBoxFor (i => item description) & lt; / Span & gt; } & Lt; / Td> & Lt; / TR & gt; } & Lt; / Tbody & gt;
& lt; Span & gt; Inline elements are they can not accept width, height.
@using (Ajax.BeginForm ("Result", New AjaxOptions {UpdateTargetId = "Result"}) ) {& Lt; Div style = "width: 5%; float: left; text-align: center" & gt; @html TextboxFor (I => item ID) & lt; / Div & gt; & Lt; Div style = "width: 35%; float: left; text-align: center" & gt; @html TextboxFor (I => item names) & lt; / Div & gt; & Lt; Div style = "width: 60%; float: left; text-align: center" & gt; @html TextboxFor (I => item description) & lt; / Div & gt; }
Comments
Post a Comment