I have a button being used to show a dropdown div. The button padding and text can be clicked on to show the dropdown div. The very small Material "font-icon" CANNOT be clicked to show the dropdown div. How can I ensure that you can click anywhere within the button (including directly on the Material icon) in order to show the dropdown div.
Here is a link to show you what I've done.
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
// Hide Header on on scroll down
var didScroll;
var lastScrollTop = 0;
var delta = 5;
var navbarHeight = $('header').outerHeight();
$(window).scroll(function(event){
didScroll = true;
});
setInterval(function() {
if (didScroll) {
hasScrolled();
didScroll = false;
}
}, 250);
function hasScrolled() {
var st = $(this).scrollTop();
// Make sure they scroll more than delta
if(Math.abs(lastScrollTop - st) <= delta)
return;
// If they scrolled down and are past the navbar, add class .nav-up.
// This is necessary so you never see what is "behind" the navbar.
if (st > lastScrollTop && st > navbarHeight){
// Scroll Down
$('header').removeClass('nav-down').addClass('nav-up');
} else {
// Scroll Up
if(st + $(window).height() < $(document).height()) {
$('header').removeClass('nav-up').addClass('nav-down');
}
}
lastScrollTop = st;
}
body {
margin: 0;
color: #333;
overflow-x: hidden;
padding-top: 80px;
}
:root{
var-MainColor: #4C00F9;
--main-color: #4C00F9;
}
header {
background: #f5b335;
height: 40px;
position: fixed;
top: 0;
transition: top 0.2s ease-in-out;
width: 100%;
}
.nav-up {
top: -64px;
}
#navWrapper {
padding: 0px;
border-bottom: 1px solid #eee;
font-size: 13px;
font-family: Sans-Serif;
width: 100%;
background-color: #fff;
z-index: 1000;
height: 64px;
}
#navLeft {
float: left;
}
#navRight {
float: right;
}
/* Dropdown Button */
.dropbtn {
background-color: transparent;
color: var(--main-color);
padding: 24px;
font-size: 13px;
border: none;
cursor: pointer;
}
/* Dropdown button on hover & focus */
.dropbtn:hover, .dropbtn:focus {
background-color: var(--main-color);
color: #fff;
outline: none;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
margin-left: 10px;
margin-right: 2%;
margin-top: -8px;
border-radius: 2px;
background-color: #fff;
min-width: 260px;
border: 0px solid #eee;
box-shadow: 0px 1px 5px 0px rgba(0,0,0,0.3);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: var(--main-color);
padding: 24px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #fdfdfd;}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}
.material-icons.md-01 { font-size: 13px; vertical-align: middle; margin-top: -3px;}
.material-icons.md-02 { font-size: 24px; vertical-align: middle; margin-top: -5px; color: red;}
.material-icons.md-03 { font-size: 24px; vertical-align: middle; margin-top: -5px; color: #40FA35;}
.material-icons.md-04 { font-size: 21px; vertical-align: middle; margin-top: -1px;}
.material-icons.md-05 { font-size: 16px; vertical-align: middle; margin-top: -1px;margin-right: 15px;}
#main {
margin-top: 50px;
position: absolute;
}
section {
width: 100%;
border-bottom: 1px solid #eee;
padding: 50px 0px;
}
#sectionInnerText {
max-width: 700px;
padding: 0px 100px;
}
#sectionInnerImage {
max-width: 1000px;
padding: 0px 100px;
}
#sectionInnerImage-rowWrapper {
padding: 0px 100px;
}
#sectionInnerImage-3row {
width: 31%;
max-width: 400px;
display: inline-block;
margin-right: 1vw;
}
#sectionInnerImage-2row {
width: 48%;
max-width: 1000px;
display: inline-block;
margin-right: 1vw;
}
h1 {
font-size: 36px;
margin-bottom: 30px;
font-weight: 700;
font-family: Sans-Serif;
}
h2 {
font-size: 22px;
font-family: Sans-Serif;
font-weight: 700;
margin-top: 15px;
}
h3 {
font-size: 13px;
font-family: Sans-Serif;
font-weight: normal;
margin-bottom: 30px;
}
h4 {
font-size: 17px;
font-family: Sans-Serif;
font-weight: 700;
margin-top: 5px;
margin-bottom: 0;
display: inline-block;
}
p {
font-size: 19px;
line-height: 180%;
font-family: Georgia, Cambria, "Times New Roman", Times, serif;
font-weight: normal;
margin: 15px 0;
}
a.one {
display: block;
color: #fff;
background-color: var(--main-color);
padding: 16px;
text-decoration: none;
text-align: center;
border-radius: 3px;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
max-width: 350px;
}
a.one:hover {
background: #4C03F1;
}
a.one:active {
background-color: var(--main-color);
}
#media only screen and (min-width: 1080px) {
section {
min-height: 30vh;
}
}
#media only screen and (max-width: 1080px) {
html, body {
margin: 0;
color: #333;
overflow-x: hidden;
}
section {
width: 100%;
border-bottom: 1px solid #eee;
padding: 0px;
}
#sectionInnerText {
padding: 2vh 5vw;
}
#sectionInnerImage {
padding: 0 5vw;
}
#sectionInnerImage-rowWrapper {
padding: 0 5vw;
}
#sectionInnerImage-3row {
width: 100%;
max-width: 1000px;
}
#sectionInnerImage-2row {
width: 100%;
max-width: 1000px;
}
p {
font-size: 21px;
}
ul li {
font-size: 21px;
}
a.one, a.two, a.three, a.four {
display: block;
margin-bottom: 25px;
max-width: 100%;
max-width: 450px;
}
.dropdown-content {
width: 100vw;
margin: 0;
margin-top: -6px;
background-color: #fff;
min-width: 260px;
border: 0px solid #eee;
border-top: 1px solid #eee;
border-bottom: 0;
z-index: 1;
box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.12);
}
.dropdown-content a{
border-bottom: 1px solid #f4f4f4;
}
}
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<header class="nav-down">
<div id="navWrapper">
<div id="navLeft">
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Menu <i class="material-icons md-01">keyboard_arrow_down</i></button>
<div id="myDropdown" class="dropdown-content">
<i class="material-icons md-05">home</i> Home & Projects List
<i class="material-icons md-05">dashboard</i> Project 01
<i class="material-icons md-05">dashboard</i> Project 02
<i class="material-icons md-05">dashboard</i> Project 03
<i class="material-icons md-05">account_circle</i> Info & Contact
<i class="material-icons md-05">picture_as_pdf</i> View & Download Resume
</div>
</div>
</div>
</div>
</header>
I'm starting to learn code in .net core 2.0 and as the first application I decided to write a simple blog system. I encountered a problem when i wanted put different header background image to the each post details page and the main one on index page. Image is passing by ViewData["Image"] to the _Layout. I tried to put the same image to the both views Index and Details but image displays only on Index page.
Index View
#model PaginatedList<MHBlog.Models.Post>
#{
ViewData["Title"] = "Index";
ViewData["Image"] = "11.jpg";
}
<h2>Index</h2>
Details View
#model MHBlog.Models.Post
#{
ViewData["Title"] = "Index";
ViewData["Image"] = Model.ImageName;
}
<h2>Details</h2>
_Layout
<header class="masthead" style="background-image: url(images/#ViewData["Image"])">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="post-heading">
<h1>Blog</h1>
<span class="subheading">My First Blog</span>
</div>
</div>
</div>
</div>
</header>
CSS
header.masthead {
margin-bottom: 50px;
background: no-repeat center center;
background-color: #777777;
background-attachment: scroll;
}
header.masthead .page-heading,
header.masthead .post-heading,
header.masthead .site-heading {
padding: 200px 0 150px;
color: white; }
#media only screen and (min-width: 768px) {
header.masthead .page-heading,
header.masthead .post-heading,
header.masthead .site-heading {
padding: 200px 0; } }
header.masthead .page-heading,
header.masthead .site-heading,
header.masthead .post-heading{
text-align: center;
}
header.masthead .page-heading h1,
header.masthead .site-heading h1 {
font-size: 50px;
margin-top: 0; }
header.masthead .page-heading .subheading,
header.masthead .site-heading .subheading {
font-size: 24px;
font-weight: 300;
line-height: 1.1;
display: block;
margin: 10px 0 0;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
#media only screen and (min-width: 768px) {
header.masthead .page-heading h1,
header.masthead .site-heading h1 {
font-size: 80px; } }
header.masthead .post-heading h1 {
font-size: 35px; }
header.masthead .post-heading .meta,
header.masthead .post-heading .subheading {
line-height: 1.1;
display: block; }
header.masthead .post-heading .subheading {
font-size: 24px;
font-weight: 600;
margin: 10px 0 30px;
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
header.masthead .post-heading .meta {
font-size: 20px;
font-weight: 300;
font-style: italic;
font-family: 'Lora', 'Times New Roman', serif; }
header.masthead .post-heading .meta a {
color: white; }
#media only screen and (min-width: 768px) {
header.masthead .post-heading h1 {
font-size: 55px; }
header.masthead .post-heading .subheading {
font-size: 30px; } }
Index page:
Details page:
I tried to set details ViewData Image to
#ViewData["Image"] = "11.jpg"
But nothing changed on details page.
Try like that style="background-image:url('/images/#ViewData["Image"]')".
<header class="masthead" style="background-image:url('/images/#ViewData["Image"]')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="post-heading">
<h1>Blog</h1>
<span class="subheading">My First Blog</span>
</div>
</div>
</div>
</div>
I tried to implement select2 plugin using the Bulma css framework but it seems messy in frontend. I tried this using bootstrap and yes there's no problem since select2 has a bootstrap compatibility.
HTML:
<div class="field">
<label class="label">Role</label>
<p class="control">
<span class="select is-fullwidth">
<select2 v-model="form.role"
placeholder="Select Role"
name="role"
:value="form.role"
:multiple="false"
>
<option></option>
<option v-for="role in roles" :value="role.id">{{ role.display_name }}</option>
</select2>
</span>
</p>
</div>
I made it work, maybe my example can help you.
View
<div class="field">
<label class="label">Hair</label>
<div class="control">
<select2 class="is-medium" v-model="post.custom_data.hair" :options="{}">
#foreach (config('post.cat.hair') as $id => $value)
<option value="{{ $id }}">{{ __($value) }}</option>
#endforeach
</select2>
</div>
</div>
SASS
.select2-wrapper {
.select2-container {
.select2-selection {
transition: border-color $speed;
font-family: $family-sans-serif;
height: 2.285em;
line-height: 1.5;
font-size: 1rem;
outline: none !important;
display: inline-flex;
align-items: center;
width: 100%;
border-color: $border;
border-radius: $radius;
&:hover {
border-color: $border-hover;
}
.select2-selection__rendered {
padding-left: 0.75em;
padding-right: 0.75em;
}
.select2-selection__arrow {
display: none;
}
}
&.select2-container--open {
.select2-selection {
border-color: $primary;
&:hover {
border-color: $primary;
}
}
}
}
&.is-medium {
.select2-container {
.select2-selection {
font-size: $size-5;
}
}
}
&.is-large {
.select2-container {
.select2-selection {
font-size: $size-4;
}
}
}
}
.select2-container {
.select2-dropdown {
border-color: $primary;
.select2-search {
margin: 10px;
.select2-search__field {
#extend .input;
border-radius: $radius !important;
}
}
.select2-results__options {
max-height: 210px;
.select2-results__option {
padding: 0.75em;
font-family: $family-sans-serif;
font-size: 1rem;
&.select2-results__option--highlighted {
background: $primary;
}
}
}
}
}
Result
Hope it helps ^^
.select2-container {
.select2-selection--single {
height: auto !important;
padding: 3px 0 !important;
border: 1px solid #dbdbdb !important;
.select2-selection__arrow{
top: 5px !important;
}
.select2-selection__placeholder {
color: #dbdbdb !important;
}
}
.select2-dropdown {
border: 1px solid #dbdbdb !important;
border-top: 0 !important;
.select2-search {
margin: 5px;
.select2-search__field {
padding: 10px !important;
border-radius: 3px !important;
font-size: 1rem;
height: 2.25em;
box-shadow: inset 0 1px 2px rgba(10,10,10,.1);
max-width: 100%;
width: 100%;
border-radius: 3px !important;
}
}
.select2-results__options {
max-height: 200px !important;
.select2-results__option {
padding: 0.37em 0.75em !important;
font-size: 1rem;
&.select2-results__option--highlighted {
}
}
}
}
}
I open issue about this.
https://github.com/jgthms/bulma/issues/1555
I've learned how to create a jquery ui tab, thanks to http://jqueryui.com/tabs, and customized the look of it. I've been searching the web on how to highlight a selected tab by changing it's background color when someone clicks on it. So far, it's been frustrated and unsuccessful.
Here's the HTML Code Use:
<!DOCTYPE html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.js"></script>
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
<title>Jquery Tab Test</title>
</head>
<body>
<div id="tab-wrapper">
<div id="tabs">
<ul>
<li>Tab 1</li>
<li>Tab 2</li>
<li>Tab 3</li>
</ul>
<br class="clearboth" />
<div id="tabs1" class="tab-content">
Content 1
</div>
<div id="tabs2" class="tab-content">
Content 2
</div>
<div id="tabs3" class="tab-content tabs3">
Content 3
</div>
</div>
</div>
</body>
and CSS:
body, html {
height: 101%;
}
body {
font-family: arial;
}
.clearboth {
clear: both;
padding: 0;
margin: 0;
}
#tab-wrapper {
background-color: #f00fff;
border: solid 1px #909090;
padding: 5px;
width: 330px;
}
#tabs {
overflow: hidden;
}
#tabs ul li,
#tabs ul {
margin: 0;
padding: 0;
list-style: none;
}
#tabs ul a {
float: left;
padding: 5px;
display: block;
width: 100px;
text-align: center;
text-decoration: none;
color: #000000;
height: 20px;
line-height: 20px;
font-size: 10pt;
font-weight: bold;
background-color: #cccccc;
}
#tabs ul a:hover {
background-color: #f1f1f1;
}
#tabs .tab-content {
padding: 5px;
display: block;
background-color: #f1f1f1;
font-size: 10pt;
height: 300px;
border-top: solid 1px #000000;
}
Please help if anyone can.
Jquery assigns the selected tab the class="ui-tabs-active" so to style it simply hook your css into it as follows:
#tabs .ui-tabs-active {
background: yellow;
}
This works for me:
#tabs .ui-tabs-active {
background: yellow;
}
but the above answer did not - the order in the css file is important - the above is after hover.
I have an issues with my first ASP.MVC 4 project where one page (only bound page so far) is showing the type of the collection at the top of the main content area. I have tried getting rid of it but am at a loss.
I'm pretty sure its something I have done but can't fix it. Any help???
Issue Here
IE9 Debug on item
Controller
Public Class FailuresController
Inherits Controller
Function Index(model As IEnumerable(Of QSmartRectificationProvider.RectificationFaults)) As ActionResult
ViewData("Message") = "Open Faults"
Return View(Session("Failures"))
End Function
End Class
_Layout.vbhtml
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>QSmart Rectifications</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
#Styles.Render("~/Content/themes/base/css", "~/Content/css")
#Scripts.Render("~/bundles/modernizr")
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-right">
<nav>
<ul id="menu">
<li>#Html.ActionLink("Log Out", "Index", "Home")</li>
</ul>
</nav>
</div>
</div>
</header>
<div id="body">
#RenderSection("featured", required:=false)
<section class="content-wrapper main-content clear-fix">
#RenderBody()
</section>
</div>
<footer>
<p>#DateTime.Now.Year - JCB Excavators LTD</p>
</footer>
#Scripts.Render("~/bundles/jquery")
#RenderSection("scripts", required:=False)
</body>
</html>
Index.vbhtml
#model QSmartRectification.QSmartRectificationProvider.RectificationFaults
#Code
ViewData("Title") = "Open Failures"
End Code
#section featured
<section class="featured">
<div class="content-wrapper" >
<p class="site-title float-left">#Html.ActionLink("QSmart Rectification Sign Off", "Index", "Home")</p>
<input type="image" src="../../Images/Product.png" />
</div>
</section>
End Section
<br />
#Using Html.BeginForm()
#Html.ValidationSummary()
#<fieldset class="fieldset clear-fix">
<legend>Open Faults</legend>
<section class="content">
<ul class="column">
#For Each item As QSmartRectification.QSmartRectificationProvider.RectificationFaults In Model
#<li>
<section class="block">
<img alt="../../Images/Default.png"; src="#String.Format("../../Images/{0}.png", item.MajorAssembly)"/>
<label class="header">Zone</label>
<label>#item.ZoneName</label>
<label class="header">Major Assembly</label>
<label>#item.MajorAssembly</label>
<label class="header">Sub Assembly</label>
<label>#item.SubAssembly</label>
<label class="header">Component Assembly</label>
<label>#item.ComponentAssembly</label>
<label class="header">Business Test</label>
<label>#item.BusinessTest</label>
<label class="header">Fault Code</label>
<label>#item.FaultCode</label>
<label class="header">Fault Code Detail</label>
<label>#item.FaultCodeDetail</label>
</section>
</li>
Next
</ul>
</section>
</fieldset>
End Using
Site.css
html {
margin: 0;
padding: 0;
background-color:#fff;
}
body {
background-color: #fff;
border-top: solid 10px #fff;
font-size: .85em;
font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
margin: 0;
padding: 0;
}
a {
color: #333;
outline: none;
padding-left: 3px;
padding-right: 3px;
text-decoration: none;
clear:none;
}
b
a:link, a:visited,
a:active, a:hover {
color: #333;
}
a:hover {
text-decoration:underline;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
.clear-fix:after {
content: ".";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
h1, h2, h3,
h4, h5, h6 {
color: #fff;
margin-bottom: 0;
padding-bottom: 0;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.75em;
}
h3 {
font-size: 1.2em;
}
h4 {
font-size: 1.1em;
}
h5, h6 {
font-size: 1em;
}
/* main layout
----------------------------------------------------------*/
.content-wrapper {
margin: 0 auto;
max-width: 960px;
background-color:#fff;
}
#body {
clear: both;
padding-bottom: 35px;
}
footer {
clear: both;
font-size: .8em;
height: 100px;
}
footer .float-left,
footer .float-right {
float: none;
}
footer {
text-align: center;
height: auto;
padding: 10px 0;
}
footer p {
margin: 0;
color:#999;
}
/* menu
----------------------------------------------------------*/
ul#menu {
font-size: 1.3em;
font-weight: 600;
margin: 0;
text-align: right;
}
ul#menu li {
display: inline;
list-style: none;
padding-left: 15px;
}
ul#menu li a {
background: none;
color:#999;
text-decoration: none;
font-size: 2em;
}
ul#menu li a:hover {
color: #333;
text-decoration: none;
}
/* page elements
----------------------------------------------------------*/
/* featured */
.featured {
background-color:#fff;
}
.featured .content-wrapper {
background-color: #eb7c04;
background-image: -ms-linear-gradient(left, #eb7c04 0%, #fff 100%);
background-image: -o-linear-gradient(left, #eb7c04 0%, #fff 100%);
background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #f8b589), color-stop(1, #fff));
background-image: -webkit-linear-gradient(left, #eb7c04 0%, #fff 100%);
background-image: linear-gradient(left, #eb7c04 0%, #fff 100%);
color: #f8b589;
padding: 5px 40px 5px 40px;
text-align:right;
display:normal;
}
.featured .site-title {
font-family: Rockwell, Consolas, "Courier New", Courier, monospace;
font-size: 3em;
color:#fff;
margin: 20px 0;
padding-top:10px;
}
.featured hgroup.title h1, .featured hgroup.title h2 {
color: #fff;
}
.featured p {
font-size: 1.1em;
}
/* page titles */
hgroup.title {
margin-bottom: 10px;
}
hgroup.title h1, hgroup.title h2 {
display: inline;
}
hgroup.title h2 {
font-weight: normal;
margin-left: 3px;
}
/* features */
section.feature {
width: 300px;
float: left;
padding: 10px;
}
/* ordered list */
ol.round {
list-style-type: none;
padding-left: 0;
}
ol.round li {
margin: 25px 0;
padding-left: 45px;
}
/* content */
article {
float: left;
width: 70%;
}
aside {
float: right;
width: 25%;
}
aside ul {
list-style: none;
padding: 0;
}
aside ul li {
background: url("../Images/bullet.png") no-repeat 0 50%;
padding: 2px 0 2px 20px;
}
label {
padding-right: 20px;
text-indent: -15px;
}
/* ajax login/registration dialog */
.ui-dialog {
font-family: inherit;
font-size: 1.0em;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
border: 0 none;
}
.ui-dialog input {
font-family: inherit;
font-size: 1.25em;
}
.ui-dialog-titlebar {
color: inherit;
font-weight: inherit;
border: 0 none;
background: none;
float: right;
}
.ui-dialog-titlebar-close {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.ui-widget-header {
border: 0 none;
background: none;
}
.modal-popup {
}
.modal-popup input[type="text"],
.modal-popup input[type="password"] {
width: 90%;
}
/* info and errors */
.message-info {
border: 1px solid;
clear: both;
padding: 10px 20px;
}
.message-error {
clear: both;
color: #e80c4d;
font-size: 1.1em;
font-weight: bold;
margin: 20px 0 10px 0;
}
.message-success {
color: #7ac0da;
font-size: 1.3em;
font-weight: bold;
margin: 20px 0 10px 0;
}
.error {
color: #e80c4d;
}
/* styles for validation helpers */
.field-validation-error {
color: #e80c4d;
font-weight: bold;
}
.field-validation-valid {
display: none;
}
input[type="text"].input-validation-error,
input[type="password"].input-validation-error {
border: 1px solid #e80c4d;
}
.validation-summary-errors {
color: #e80c4d;
font-weight: bold;
font-size: 1.1em;
}
.validation-summary-valid {
display: none;
}
/********************
* Mobile Styles *
********************/
#media only screen and (max-width: 850px) {
/* header
----------------------------------------------------------*/
header .float-left,
header .float-right {
float: none;
}
/* logo */
header .site-title {
margin: 10px;
text-align: center;
}
/* menu */
nav {
margin-bottom: 5px;
}
ul#menu {
margin: 0;
padding: 0;
text-align: center;
}
ul#menu li {
margin: 0;
padding: 0;
}
/* main layout
----------------------------------------------------------*/
.main-content,
.featured + .main-content {
background-position: 10px 0;
}
.content-wrapper {
padding-right: 10px;
padding-left: 10px;
background-color:#fff;
}
.featured .content-wrapper {
padding: 10px;
}
/* page content */
article, aside {
float: none;
width: 100%;
}
/* ordered list */
ol.round {
list-style-type: none;
padding-left: 0;
}
ol.round li {
padding-left: 10px;
margin: 25px 0;
}
ol.round li.zero,
ol.round li.one,
ol.round li.two,
ol.round li.three,
ol.round li.four,
ol.round li.five,
ol.round li.six,
ol.round li.seven,
ol.round li.eight,
ol.round li.nine {
background: none;
}
/* features */
section.feature {
float: none;
padding: 10px;
width: auto;
}
section.feature img {
color: #999;
content: attr(alt);
font-size: 1.5em;
font-weight: 600;
}
}
.fieldset {
border-radius: -moz-border-radius(15px);
border-radius: -webkit-border-radius(15px);
border-radius: -ms-border-radius(15px);
border-radius:15px;
width: 100%;
background: #f7d7a5;
padding: 3px;
margin-left:10px;
margin-right:10px;
}
.fieldset legend {
background: #CCA383;
padding: 6px;
font-weight: bold;
border-radius: -moz-border-radius(15px);
border-radius: -webkit-border-radius(15px);
border-radius: -ms-border-radius(15px);
border-radius:15px;
}
/* content layouts
----------------------------------------------------------*/
.content {
position: relative;
float: left;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-ms-border-radius: 15px;
border-radius: 15px;
margin-right: 15px;
margin-left: 15px;
}
.content h2
{
font-size: 3em;
font-weight: 600;
color:red;
}
.content label.checkbox {
display: inline;
}
.content input[type="text"],
.content input[type="password"] {
border: 1px solid #e2e2e2;
color: #333;
font-size: 4em;
width: 400px;
}
.content input[type="text"]:focus,
.content input[type="password"]:focus {
border: 1px solid #7ac0da;
}
.content label {
font-size: 4em;
font-weight: 600;
}
.content input[type="submit"],.content input[type="button"] {
background-color: #eb7c04;
background: #eb7c04; /* Old browsers */
background: -moz-linear-gradient(top, #eb7c04 1%, #f1c487 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#eb7c04), color-stop(100%,#f1c487)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #eb7c04 1%,#f1c487 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #eb7c04 1%,#f1c487 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #eb7c04 1%,#f1c487 100%); /* IE10+ */
background: linear-gradient(top, #eb7c04 1%,#f1c487 100%); /* W3C */
border: 4px solid #000;
border-radius: -moz-border-radius(15px);
border-radius: -webkit-border-radius(15px);
border-radius: -ms-border-radius(15px);
border-radius:15px;
cursor: pointer;
font-size: 3em;
font-weight: 600;
padding: 7px;
}
.content ul.column {
width: 100%;
padding: 0;
margin: 10px 0;
list-style-type: none;
}
.content ul.column li {
float: left;
max-width: 230px;
display: inline;
}
.content .block {
margin: 5px;
padding: 10px;
background: #eb7c04;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius:10px;
height: 400px;
width: 200px;
max-height: 400px;
max-width: 200px;
min-height: 400px;
min-width: 200px;
}
.content .block a {
color: #FFF;
}
.content .block img {
width: 89%;
height: 100px;
padding: 5px;
margin: 0px;
background:#fff;
-ms-interpolation-mode: bicubic;
}
.content .block label
{
font-weight: 200;
font-size: 1em;
text-indent: 5px;
display: block;
}
.content .block label.header
{
font-weight: 600;
text-decoration: underline;
}
View Source snippet
<div id="body">
<section class="featured">
<div class="content-wrapper">
<p class="site-title float-left">
QSmart Rectification Sign Off
</p>
<input type="image" src="../../Images/Product.png" />
</div>
</section>
<section class="content-wrapper main-content clear-fix">
System.Linq.OrderedEnumerable`2[QSmartRectification.QSmartRectificationProvider.RectificationFaults,System.Int64] QSmartRectification.QSmartRectificationProvider.RectificationFaults
<br />
<form action="/Failures" method="post">
<div class="validation-summary-valid" data-valmsg-summary="true">
<ul>
<li style="display: none;"></li>
</ul>
</div>
<fieldset class="fieldset clear-fix">
<legend>Open Faults</legend>
<section class="content">
<ul class="column">
<li>
<section class="block">
<img alt="../../Images/Default.png" src="../../Images/Hydraulic System.png" ;="" />
<label class="header">Zone</label>
<label>Wheeled SIP 1</label>
<label class="header">Major Assembly</label>
<label>Hydraulic System</label>
<label class="header">Sub Assembly</label>
<label>Valve Blocks</label>
<label class="header">Component Assembly</label>
<label>Hammer Valve</label>
<label class="header">Business Test</label>
<label>Hammer Hoses</label>
<label class="header">Fault Code</label>
<label>Adjust / Align</label>
<label class="header">Fault Code Detail</label>
<label>Fouling</label>
</section>
</li>
<li>
<section class="block">
<img alt="../../Images/Default.png" src="../../Images/Engine Bay.png" ;="" />
<label class="header">Zone</label>
<label>Wheeled SIP 1</label>
<label class="header">Major Assembly</label>
<label>Engine Bay</label>
<label class="header">Sub Assembly</label>
<label>Air Conditioning</label>
<label class="header">Component Assembly</label>
<label>Compressor</label>
<label class="header">Business Test</label>
<label>Installation</label>
<label class="header">Fault Code</label>
<label>Adjust / Align</label>
<label class="header">Fault Code Detail</label>
<label>Twisted</label>
</section>
</li>
Model snippet from WCF Service
'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.17626"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://schemas.datacontract.org/2004/07/vFrame.Service.Qsmart.Sync")> _
Partial Public Class RectificationFaults
Inherits Object
Implements System.ComponentModel.INotifyPropertyChanged
Private auditScoreField As String
Private businessTestField As String
Private commentField As String
Private componentAssemblyField As String
Private createdByField As String
Private failureIDField As Long
Private failureIDFieldSpecified As Boolean
Private faultField As String
Private faultAreaField As String
Private faultCodeField As String
Private faultCodeDetailField As String
Private fixedByCommentField As String
Private fixedByFaultRectificationIDField As Integer
Private fixedByFaultRectificationIDFieldSpecified As Boolean
Private fixedByIDField As Integer
Private fixedByIDFieldSpecified As Boolean
Private majorAssemblyField As String
Private modelNameField As String
Private shortagePartField As String
Private subAssemblyField As String
Private zoneNameField As String
Ok a couple of things, remove the # symbol from the fieldset element second change the for Each syntax and last it's a recomedation you should use the #html helpers instead using the plain html, you code should see like this
<fieldset class="fieldset clear-fix">
<legend>Open Faults</legend>
<ul>
#For Each item In Model
Dim currentItem = item
#<li>
<section class="content">
<img alt="../../Images/Default.png"; src="#String.Format("../../Images/{0}.png", item.MajorAssembly)"/>
</section>
<label class="header">Zone</label>
<label>#item.ZoneName</label>
</li>
Next
</ul>
UPDATE
Check the Action of your controller, because assuming that you're calling this action from a wcf service, you should passed the data to the view like this
Public Class FailuresController
Inherits Controller
Function Index(model As IEnumerable(Of QSmartRectificationProvider.RectificationFaults)) As ActionResult
ViewData("Message") = "Open Faults"
'Return View(Session("Failures"))
Return View(model) 'this is how the data is sending to the view
End Function
End Class