vendredi 31 juillet 2015

Blurry text in Internet Explorer

On my website I have noticed that there is a substantial difference in text quality between Firefox, Chrome, and Internet Explorer. While the text is crystal clear in Chrome, and even more so in Firefox, it seems blurred and out-of-focus in Internet explorer. Here is a picture comparison:

Screenshot comparison of Firefox and IE

Personally I think it is not aesthetically pleasing to the eye. I would like to find a solution without asking users to use plugins like Microsoft Silverlight, as not all users will want to install a plugin just to view 1 website. I don't understand how websites like Facebook and StackOverflow don't have this problem (or at least less of a problem).

I've tried using CSS filters, different font-rendering properties, and using different units for font-size, but I'm seeing no effect. I know I haven't tried all possible CSS property combinations so this could still be the answer.

I've been scouring the web and StackOverflow for hours now, and have yet to find a solution. There are other similar questions here but they remain unanswered.

Any help, or idea of where to go or what to do, is very much welcomed. Run this Snippet in different browsers:

html,body{
  margin:0;
  height:100%;  
  font: normal 14px/24px "Lucida Sans Unicode","Lucida Grande", "Arial", sans-serif;
}
div{
  text-align: center;
  vertical-align: middle;
  display: inline-block;
  white-space: nowrap;
  background-color:rgb(28, 31, 37);
  color:white;
  padding:1em;
}
p{
  font-size: small;
}
input{
  padding: 16px 12px;
  width: 250px;
  border: 0;
  background: #0A0A0A;
  color: #eee;
  font-size: 14px;
  font-family: "Open Sans",sans-serif;
  -webkit-box-shadow: inset 0 0 0 1px #323742;
  -moz-box-shadow: inset 0 0 0 1px #323742;
  box-shadow: inset 0 0 0 1px #323742;
}
}
<div>
  <h1>Compare this text</h1>
  <p>And this text as well</p>
  <input type="text" placeholder="Even placeholders are blurry">
</div>

The Snippet actually looks similar in different browsers: but looking carefully there are definite differences though. Chrome (Version 44.0.2403.125 m) seems to have a sharp edge effect. IE (11) seems to have a slight blur. Whereas Firefox (38.0.1), as explained by @user4749485, seems to have selected the best of both worlds to achieve the best legibility. Is there a way to manually calculate and adjust the font for IE only? (Another possible method to fix it)

I'm not sure where the rest blur is coming from (the Snippet's text seems clearer here, than the text on my website). If we can uncover where this difference comes from then perhaps this will be easier to solve.

TL:DR, and just to elaborate the question: I would like the text to look clear in IE like it does in Firefox or Chrome.

swift convert html to pdf but the CSS formatting disappear

I am now have UIWebView in my view controller , and I have the html file ( Template.html, including the css inside),using the Mustache to load the data to the html, just like this:

let template = Template(named: "Template")!
let rendering = template.render(Box(self.data))!

and then show it on the webview using this

self.webView.loadHTMLString(rendering, baseURL: nil))
self.webView.scalesPageToFit = true;

all it works well. Then I wanna transform this html to pdf and also show on the same web view, but it looks that all my css layout doesn't work anymore. It only show me the html text and without layout setting by the css. I used this method to convert to pdf: http://ift.tt/1yVWGFb

and the only change is

let fmt = UIMarkupTextPrintFormatter(markupText: rendering)
render.addPrintFormatter(fmt, startingAtPageAtIndex: 0)

and then save the pdf, and load it again by the web view

let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! NSString
var pdfFile = documentsPath.stringByAppendingPathComponent("invoice.PDF")

pdfData.writeToFile(pdfFile, atomically: true)
let url : NSURL! = NSURL(string: pdfFile)
webView.loadRequest(NSURLRequest(URL: url))

But now the pdf has no layout provided by the css(such like the color, the position), but still has the html layout(such like the <\br>), I don't know why, please help me!!! Thanks !!!

centering a navbar when screen resizes

I am trying to centre my navbar, after my screen resizes to a smaller size. I have made sure that my class containing my navigation: .menu has the following

display: 
inline-block; 
margin: 0px auto;

It still doesn't centre...

However, my logo contained in the div above, has the same properties and it is able to centre when the screen resizes.

Can anybody give me some insight?

2 container side by side one fixed one dynamic height

Have a look at the jsFiddle:

http://ift.tt/1I6XduC

I want these divs to be exactly like this but without this part

top: 50%;
margin-top: -100px;

because it causes the divs to go out of the view field once its too small.

I also like to change the fixed div to be on top of the other and not fixed anymore once the window is smaller.

at best without the need of javascript.

I'd also like the dynamic height div to create height for the body, since i have a background image div which has to be the whole height of the page.

Edit: after all I found a solution with a media Query: http://ift.tt/1KEWJjf

Sidebar not loading correct place

I am using a theme oxygen theme on wordpress but the sidebar is not showing correct you can see its url here

http://ift.tt/1I8opJq

You can see the sidebar is showing to the bottom left I have tried changing the main div containers width to fix it but it does not appear to solve the issue

document.write() style position after load

I have three php file that can be recalled by document.write() ... But their 'div Style' place is in the chaotic format. I want to take them on a regular basis...

file1.php with 120*240 pixel :

document.write('
<?php 
//some PHP codes
//echo style
echo"<style>#ps2{height:240;width:120;line-height:12px;font-family:tahoma;}
p a{text-decoration:none;}</style>";
echo("<div id=\"ps2\">");
//some PHP codes
echo"</div>";
?>
');

Calling php file :

<script language="javascript" src="file1.php"></script>

if i call file2.php with 468*60 pixel and file3.php with125*125 pixel in the same page , how can i fix all codes displayed separately and regular.

  • And displayed in any page separately and regular not only in a specific page with specific css... thanks

I am using XSL, and trying to get a template to change appearances depending on a radio click. Here is my xsl:

    <xsl:template name="process">
       <div id="option1" style="display:none"/>
           <tr>
              <b> Processing Option 1 </b>
           </tr>
       </div>
       <div id="option2"/>
           <tr>
              <b> Processing Option 2 </b>
           </tr>
       </div>
    </xsl:template>

How would I access the two different <div>'s? My intention is to access these two different <div>'s through buttons; when one button is clicked, the template will show option 1, and when another is clicked, option 2 will show.

I have the buttons set up, but Im not sure how to access these 's and switch them from display:none, to display:block, and from display:block, to display:none.

Please let me know what I can do. Thanks!

CSS inline-block white space [on hold]

I need to render white space in inline-block but instead of white space, I will not render anything. I can not figure out where the CSS'm wrong.

CSS:

.foo {
    display:inline-block;
}

HTML:

<span class="foo">a</span><span class="foo"> </span><span>class="foo">b</span>

`http://ift.tt/1IdOUel

How to remove padding from first and last row element properly in Twitter Bootstrap

I've been using bootstrap for quite a while now and I'm facing this problem for the first time. I really don't know how to do this. I have found many people suggesting to just remove padding-left on the first-child element and the last one. I also tried this way at first but then I realized that it couldn't work, since the .col class has the box-sizing: border-box; property which makes the div to have padding included in the width. (Which is obviously necessary if you want a clean layout using width: 25%;).

So, if you remove these padding on the left, the first and last div are going to be 15px larger, which breaks the layout... I want every col div to have exactly the same width, I want them to fit 100% of the row and have no padding left or right. Is there a class that I'm not aware of in bootstrap?

Is it possible while keeping the Bootstrap 3 templating system?

Code example:

 <div class="row">
    <div class="col-md-3"></div>
    <div class="col-md-3"></div>
    <div class="col-md-3"></div>
    <div class="col-md-3"></div>
 </div>

flex layout behaving incorrectly on webkit(chrome/safari) vs moz(firefox)

I am using flex and it is displaying incorrect behavior on mozilla(-moz-) and chrome/safari(-webkit-)

Used mozilla tutorial to learn about flex layout

/** {
    border: solid;
    border-width: 0 1px;
}*/

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.tab3 {
    display: flex;
    display: -webkit-flex;
    flex-flow: row;
    -webkit-flex-flow: row;
    -moz-flex-flow: row;
    width: 100%;
    height: 100%;
}

.left-pane {
    display: flex;
    display: -webkit-flex;
    flex: none;
    -webkit-flex: none;
    -moz-flex: none;
    flex-flow: column;
    -webkit-flex-flow: column;
    -moz-flex-flow: column;
    width: 150px;
    height: 100%;
    min-width: 150px;
    background-color: red;
}

.content-list {
    flex: auto;
    -webkit-flex: auto;
    -moz-flex: auto;
    background-color: lightgreen;
}

.left-bottom-content {
    flex: none;
    -webkit-flex: none;
    -moz-flex: none;
    height: 50px;
    background-color: orange;
}

.right-pane {
    display: flex;
    display: -webkit-flex;
    flex-flow: column;
    -webkit-flex-flow: column;
    -moz-flex-flow: column;
    flex: auto;
    -webkit-flex: auto;
    -moz-flex: auto;
    height: 100%;
    min-width: 300px;
}

.right-pane-content {
    display: flex;
    display: -webkit-flex;
    flex-flow: row;
    -webkit-flex-flow: row;
    -moz-flex-flow: row;
    flex: auto;
    -webkit-flex: auto;
    -moz-flex: auto;
    width: 100%;
}

.right-first {
    display: flex;
    display: -webkit-flex;
    flex-flow: column;
    flex: none;
    -webkit-flex: none;
    -moz-flex: none;
    width: 30%;
    height: 100%;
    background-color: green;
}

.right-second {
    display: flex;
    display: -webkit-flex;
    flex-flow: column;
    flex: none;
    -webkit-flex: none;
    -moz-flex: none;
    width: 70%;
    height: 100%;
    background-color: blue;
}

.right-bottom-content {
    flex: none;
    -webkit-flex: none;
    -moz-flex: none;
    width: 100%;
    height: 100px;
    background-color: yellow;
}
<div class="tab3">
            <div class="left-pane">
                <div class="content-list">
                    <h3>4</h3>
                </div>
                <div class="left-bottom-content">
                    <h3>5</h3>
                </div>
            </div>
            <div class="right-pane">
                <div class="right-pane-content">
                    <div class="right-first cell-3">
                        <h3 class="right-heading">8</h3>
                    </div>
                    <div class="right-second cell-4">
                        <h3 class="some-heading">9</h3>
                    </div>
                </div>
                <div class="right-bottom-content">
                    <h3>7</h3>
                </div>
            </div>
        </div>

Screenshot for better comprehension: Firefox display firefox result

Chrome display chrome result

Thanks

What is the better approach to display the accordion list element with in responsive container?

I created the following Ionic example in codepen which is based on the Accordion and Flex Box.

List of skills are populated in different columns inside the flex container which is responsive i.e., the number of columns in which skills are generated are depended on the screen size.

For screen-size >960 px, skills are displayed in 3 columns.

For screen-size >480 px && <960 px, skills are displayed in 2 columns.

For screen-size <480 px, skills are displayed in 1 column.

The Issue:

When we display skills in more than one column, everything seems to be fine until we expand a Skill having few sub-skills which is actually pushing whole row to down and creating some space to the side which is not acceptable and trying to figure out what is the best why to handle it at the same time it should responsive

For Example: if skills are populated in 2 columns and we expand Java skill, we can see that there is some space between iOS Development and Web Development. [![enter image description here][1]][1]

Please kindly help me out what are the different approaches we can adopt so that Skills are populated in different columns based on the screen-size and at the same time without any performance issues.

// HTML
<ion-content>
       <div class="flex-container wrap">
      <div ng-repeat="skill in skills">
        <ion-checkbox ng-model="skill.isSelected" ng-click="skillClick(skill)">
          {{ skill.name }}
          <i class="icon-right ion-chevron-right" ng-class="{rotate90deg : skill.isExpanded}" style="float:right" ng-show="skill.subSkills"></i>
        </ion-checkbox>

        <ion-checkbox ng-repeat="subSkill in skill.subSkills" class="item-accordion" ng-show="skill.isExpanded" ng-click="subSkillClick(skill, subSkill)" ng-model="subSkill.isChecked">
          {{ subSkill.name }}
        </ion-checkbox>
      </div>
    </div>
    </ion-content>

// CSS
.flex-container {
    padding: 0;
    margin: 0;
    list-style: none;
    border: none;
    -ms-box-orient: horizontal;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -moz-flex;
    display: -webkit-flex;
    display: flex;
}

.wrap {
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.flex-container.wrap > div {
    width: 50%;
}

@media (max-width: 320px) {
    .flex-container.wrap > div {
        width: 100%;
        max-width: 100%;
        text-overflow: '';
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (min-width: 321px) {
    .flex-container.wrap > div {
        width: 100%;
        max-width: 100%;
        text-overflow: '';
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (min-width: 480px) {
    .flex-container.wrap > div {
        width: calc(100% / 2);
        max-width: calc(100% / 2);
        text-overflow: '';
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (min-width: 640px) {
    .flex-container.wrap > div {
        width: calc(100% / 2);
        max-width: calc(100% / 2);
        text-overflow: '';
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (min-width: 960px) {
    .flex-container.wrap > div {
        width: calc(100% / 3);
        max-width: calc(100% / 3);
        text-overflow: '';
        white-space: nowrap;
        overflow: hidden;
    }
}

// JS
angular.module('ionicApp', ['ionic'])

.controller('MyCtrl', function($scope) {

  $scope.skills = [{
        name: 'Java',
        isSelected: false,
        isExpanded: false,
        selectedsubSkills: 0,
        subSkills: [{
            name: 'Core Java',
            isSelected: false
        }, {
            name: 'SubSkill2',
            isSelected: false
        }, {
            name: 'SubSkill3',
            isSelected: false
        }]
    }, {
        name: 'iOS Development',
        isSelected: false,
    }, {
        name: 'Networking',
        isSelected: false,
        isExpanded: false,
        selectedsubSkills: 0,
        subSkills: [{
            name: 'SubSkill1',
            isSelected: false
        }, {
            name: 'SubSkill2',
            isSelected: false
        }, {
            name: 'SubSkill3',
            isSelected: false
        }]
    }, {
        name: 'Web Development',
        isSelected: false,
        selectedsubSkills: 0,
        subSkills: [{
            name: 'HTML5',
            isSelected: false
        }, {
            name: 'CSS3',
            isSelected: false
        }, {
            name: 'JavaScript',
            isSelected: false
        }, {
            name: 'JQuery',
            isSelected: false
        }, {
            name: 'PHP',
            isSelected: false
        }]
    }];

  $scope.skillClick = function(skill) {

        if (skill.subSkills) {
            skill.isExpanded = !skill.isExpanded;

            if (skill.selectedSubSkills > 0) {
                skill.isSelected = true;
            } else {
                skill.isSelected = false;
            }
            /* In Ionic, resize is slow when ion-content changes.
              Refer : http://ift.tt/1M22uYp */
            if ($scope.isIonicApp === true) {
                var ionicScrollDelegate = $injector.get('$ionicScrollDelegate');
                ionicScrollDelegate.resize(); // Resize view
            }
        }
    };

});

Cannot get the text color black to transition into white (fade from one into the other) - JQuery UI

Basically I want to transition the words in the div 'clickToContinue' from black to white, so that it fades into the other color. First I tried (directions at: http://ift.tt/1MCCcfu):

$("#logoBarImage").click(function(){
$("#paddingDiv").animate({
height: "0",
},1000);

$("#clickToContinue").animate({
color: "#FFFFFF",
}, 1000);
});

But no effect (except for the shrinking of the padding). So instead of using animation, I used directions (http://ift.tt/1KGfAaL) to get one class to transition into another (where the original class is 'clickToContinue' and the other is 'clicked' - of course the difference between the classes is a matter of color):

$("#logoBarImage").click(function(){
$("#paddingDiv").animate({
height: "0",
},1000);

$("#clickToContinue").toggleClass( "clicked", 1000, "linear" );
});

But still no transition, although paddingDiv still shrinks fine. The word just stays black.

Here are what I think the relevant parts of the code are that might be causing the problem; please fix so that the black may transition into white:

<!doctype html>

<head>

<meta charset="utf-8" />
<meta http-equiv="Content-type" contents="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial scale=1" />

<script type="text/javascript" src="http://ift.tt/J5OMPW"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">

<style>

#clickToContinue {
text-shadow: 0.1em 0.1em #E5E5E5;
color: black;  
}

.clicked {
color: white;  
}

</style>

<body>

<div id="paddingDiv"> </div>

<div id="logoBarImage"><img src=""/></div>

<div id="clickToContinue">
<p>(please click on the logo to continue)</p>
</div>

</body>

CSS Change color based on attribute of closest class

This process has been driving me nuts. I am trying to make foundations abide system look nicer. I have created a system that replaces the error class with a success and error system. Everything works well except I am having an issue displaying the success once the field is checked.

HTML

<form data-abide="ajax" id="addNewUser" novalidate="novalidate">
    <div>
        <label class="label" for="fname"><span class="requiredRed">*</span> First Name</label>
        <input type="text" id="fname" name="fname" required="" value="Douglas" aria-invalid="false">
        <div class="fa fa-info-circle errspan fail" style=""><div><p>You must enter a First Name</p></div></div>
        <div class="fa fa-check-circle errspan success"></div>
    </div>
</form>

I have been trying to find if there is a easy way through css to display success based on the 'aria-invalid' attribute such as.

[data-abide] input[aria-invalid='false'] + div.success{ display:block; }

Making anchor (button) fit the same height as the text next to it

Disclaimer: I have seen similar posts, but not one quite like mine, hence why I am posting now.

At the moment I have the following:

<div class="textwidget">
<p style="width: 69%;">
Yo, I'll tell you what I want, what I really really want, 
So tell me what you want, what you really really want, 
I'll tell you what I want, what I really really want, 
So tell me what you want, what you really really want, 
I wanna, I wanna, I wanna, I wanna, I wanna really really really wanna zigazig ha. 
If you want my future forget my past, 
If you wanna get with me better make it fast, 
Now don't go wasting my precious time, 
Get your act together we could be just fine 
I'll tell you what I want, what I really really want, 
So tell me what you want, what you really really want, 
I wanna, I wanna, I wanna, I wanna, I wanna really really really wanna zigazig ha. 
</p>
<a class="button overlay-btn" href="http://www.google.com" >A link</a></div>

With the following CSS:

.button, button, input[type="submit"] {
  background-color: #ff6600;
  font-family: "futura-pt";
  font-size: 30px;
  margin: 0;
  text-transform: lowercase;
}
.overlay-btn {
  position: absolute;
  width: 30%;
  right: 0;
  top: 0;
}

I essentially want/need the button height to extend all the way down to the same bottom as the last line of the text.

Is there a reasonable way to achieve this? As always the simpler the better. I would really appreciate the help, since as a CSS beginner, I've been trying all day with no success.

Font pixels vs points?

I'm taking a designers specs and converting them into HTML/CSS. I keep running into the same problem though - the designer will spec a rectangle with some text centered vertically in it. He'll specify the height of the rectangle at 36 pixels and the font at 18px. I'll create a 36 pixel DIV with no border and 9 pixel padding-top (using box-model built into bootstrap). The text is always too far down though. It looks like the text is bigger than 18 pixels. Taking a screenshot and measuring in Photoshop shows the text is 20 pixels high.

Am I missing something? Are pixels inconsistent from screen to screen? Is a font pixel different than a screen pixel? I've read fonts should be in points now for high DPI screens. Does it matter?

Why is the Validator jQuery plugin not validating with this configuration?

I have the following HTML and jQuery in a Sharepoint .ascx file, trying to validate, for now, just one "required" field (name):

<html>
. . .
<form id="firstform">
    <label class="firstblocklabel finaff-webform-field-label">Traveler's name:</label>
    <input class="firstblockinput finaff-webform-field-input" type="text" name="travelername" id="travelername" title="Last Name, First Name, Middle Initial" required/>
    </br>
    . . .
</form>
</html>

<script src="http://ift.tt/1IzeJcy" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('[id$=firstform]').validate();
    });
</script>

...but it doesn't work; entering into the "travelername" input text an exiting it empty, or adding a value then deleting it and exiting, does not invoke a "Please enter a val" or whatever msg it should be, near the "travelername" text input element.

As you can see, "travelername" is tagged as "required", I'm referencing the validate plugin, and I'm calling validate() in the ready function.

Do I also need to add a reference to a .CSS file?

Note: I also tried this url:

...but that also does not work.

Note that I have a similar question here, but in this case I'm not using any code-behind, so it should be simpler to get this working.

Background image rotated itself 90deg [on hold]

I added an background image inside a container that was smaller than the image. It was part of the plan. Even though it automatically rotated itself 90deg, without me touching anything (there was 3 other boxes with the exact same settings, not the same image though.). Any idea how to fix that, or what it is happening?

EDIT: Issue solved, Kyle Shrader told me to use and EXIF tool, which I did. That told me the photo was rotated 90 degree, in the metas, even though it looked fine front end. I used an exif editor and put it on Horizontal (normal value for a photo) instead of Rotated 90 CW.

I'd like to know, if there is any way to replace the default button of <b:commandButton> with a <b:iconAwesome>.

However, it does work with a <h:commandLink>, perfectly.

<h:commandLink>
    <b:iconAwesome name="arrow-down"></b:iconAwesome>
</h:commandLink>

And with replacing, I mean fully replaced and not, that the icon is on the button. Just check the working code above.

Are there other hints to be mentioned?

(Note: <b:...> is a component of BootsFaces.)

how to make multiselect select box with images showing in options [duplicate]

This question already has an answer here:

I am trying to make a multiple select box after searching I found one that I wanted to build.

Desired Outcome

  <select multiple="multiple">
        <option value="1">January</option>
        <option value="12">December</option>
    </select>

    <script src="jquery.multiple.select.js"></script>
    <script>
        $('select').multipleSelect({
            isOpen: true,
            keepOpen: true
        });
  </script>

Overlaying div across jumbotron

I'm a complete noob with programming. I am working on a project and I can't figure out the last piece. I am using bootstrap to create a jumbotron and I want to create an overlay with text information. Below is my code.

Thanks.

<div class="jumbotron" style="background-color: white;" >
    <img class="img-responsive"  src="images/sanDiegFallback.png"> 
        <div class="overlay">
            <h1>ReCon 2015</h1>
                    <div class="fadeInDown">
                        <p>October 14-16, 2015</p>
                    </div>
                    <div class="fadeInDown2">
                      <p>Marriott Marquis<br />San Diego, CA</p>
                    </div>
                    <div class="fadeInDown3">
                     <p>Registration open now<br />
                        <span style="font-size: 14px; line-height: 18px;">(Watch your inbox for details)</span>
                    </div>
                    <div class="fadeInDown4">
                     <a class="cta" href="https://twitter.com/intent/tweet?text=Save+the+date+for+%23ReCON2015+in+San+Diego%3A+October+14-15+http://is.gd/FkQv3k+%40SVISanDiego" style="background-color:none;
                background-image: src(images/twitter_bg.png);
                border:2px solid #ffffff;
                border-radius:25px;
                color:#ffffff;
                display:inline-block;
                font-family: 'proxima_nova_rgregular', Helvetica, Arial, sans-serif;
                font-size:18px;
                line-height: 18px;
                text-decoration:none;
                padding: 15px 35px;
                text-indent: 20px;
                " target="_blank">Share on Twitter</a>
                    </div>
    </div>
</div>

How to combine Lightbox and bxSlider?

I am trying to use bxSlider to create an image carousel and to use Lightbox to make the affect that upon clicking the image it will show larger (as demonstrated in the "Two individual images" section in the Lightbox website I've linked).

I have first managed to use the bxSlider to create the carousel, the code for this in my case looks like this

                  <div class="slider1">
                        <div class="col-md-3 col-sm-6 col-xs-12 wow fadeIn" data-wow-offset="50" data-wow-delay="0.6s">
                            <div class="portfolio-thumb">
                                <div class="slide"> 
                                    <img src="images/portfolio-img1.jpg" class="img-responsive" alt="portfolio img 1">
                                </div>
                            </div>
                        </div>
                 </div>

where inside the first div ("slider1") I have a div clas "col -..." for each image in the gallery. In this code example I have included the code for the first image.

The result looks like this

enter image description here

Now I want to add the Lightbox functionality, and this is where I'm having problems.

Instead of the I have tried using something like

<a href="link-to-the-image.jpg" data-lightbox="gallery-name"><img alt="" src="link-to-the-image.jpg"/></a>

like I have seen both on the Lightbox website and on the following SO question

but what I get is that when I click the image in the carousel I get to a new page with only the image:

enter image description here

I remembered to link to the lightbox.css and to the lightbox.js files, as in the instructions on the lightbox website.

Any ideas about why the lightbox functionality isn't working for me and how to fix it ?

How to display an error if the check box is not checked? [duplicate]

This question already has an answer here:

I am a newbie in jquery

3 hours how to solve this problem, but does not work

How to display an error if the checkbox is not checked?

I would be glad of any help

My code

Fiddle

$("#test_inner .test-item").each(function (e) {
        if (e != 0) $(this).hide();
    });

    var i = 0;
    $(".next-btn").click(function () {
        i++;
        if (i == 3) {
            $(this).hide();
        }
        if ($("#test_inner .test-item:visible").next().length != 0) $("#test_inner .test-item:visible").next().show().prev().hide();
        else {
            $("#test_inner .test-item:visible").hide();
            $("#test_inner .test-item:first").show();
        }
        return false;
    });
<script src="http://ift.tt/VorFZx"></script>
<div id="test_inner">
    <div class="test-item">DIV1
        <br/>
        <label><input type="radio" name="r1" value="1" />1</label><label>
            <input type="radio" name="r1" value="2" />2</label><label>
            <input type="radio" name="r1" value="3" />3</label>
        </div>
    <div class="test-item">DIV2
        <br/>
        <label><input type="radio" name="r2" value="1" />1</label>
        <label><input type="radio" name="r2" value="2" />2</label>
        <label><input type="radio" name="r2" value="3" />3</label>
    </div>
    <div class="test-item">DIV3
        <br/>
        <label><input type="radio" name="r3" value="1" />1</label>
        <label><input type="radio" name="r3" value="2" />2</label>
        <label><input type="radio" name="r3" value="3" />3</label>
    </div>
    <div class="test-item">DIV4
        <br/>
        <label><input type="radio" name="r4" value="1" />1</label>
        <label><input type="radio" name="r4" value="2" />2</label>
        <label><input type="radio" name="r4" value="3" />3</label>
    </div>    
    
    <a href="#" class="next-btn">send</a>

</div>

Thank you in advance

How to create multiple IDS?

How can I create multiple ID'S from the script to perform several open-transitons? document.getelementbyname does not seem to work form me.

As you can see if you scroll towards the middle of the demo result window you will see the first button opening both transitions while the second button (three dots) does nothing, I want the second button to open the bottom transition on its own.

DEMO

SCRIPT

 /*!
  * classie - class helper functions
  * from bonzo http://ift.tt/KBgvhX
  * 
  * classie.has( elem, 'my-class' ) -> true/false
  * classie.add( elem, 'my-new-class' )
  * classie.remove( elem, 'my-unwanted-class' )
  * classie.toggle( elem, 'my-class' )
  */

 /*jshint browser: true, strict: true, undef: true */
 /*global define: false */

 (function (window) {

     'use strict';

     // class helper functions from bonzo http://ift.tt/KBgvhX

     function classReg(className) {
         return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
     }

     // classList support for class management
     // altho to be fair, the api sucks because it won't accept multiple classes at once
     var hasClass, addClass, removeClass;

     if ('classList' in document.documentElement) {
         hasClass = function (elem, c) {
             return elem.classList.contains(c);
         };
         addClass = function (elem, c) {
             elem.classList.add(c);
         };
         removeClass = function (elem, c) {
             elem.classList.remove(c);
         };
     } else {
         hasClass = function (elem, c) {
             return classReg(c).test(elem.className);
         };
         addClass = function (elem, c) {
             if (!hasClass(elem, c)) {
                 elem.className = elem.className + ' ' + c;
             }
         };
         removeClass = function (elem, c) {
             elem.className = elem.className.replace(classReg(c), ' ');
         };
     }

     function toggleClass(elem, c) {
         var fn = hasClass(elem, c) ? removeClass : addClass;
         fn(elem, c);
     }

     var classie = {
         // full names
         hasClass: hasClass,
         addClass: addClass,
         removeClass: removeClass,
         toggleClass: toggleClass,
         // short names
         has: hasClass,
         add: addClass,
         remove: removeClass,
         toggle: toggleClass
     };

     // transport
     if (typeof define === 'function' && define.amd) {
         // AMD
         define(classie);
     } else {
         // browser global
         window.classie = classie;
     }

 })(window);


 /**
  * main.js
  * http://www.codrops.com
  *
  * Licensed under the MIT license.
  * http://ift.tt/j1ALGl
  * 
  * Copyright 2014, Codrops
  * http://www.codrops.com
  */ (function () {

     var bodyEl = document.body,
         content = document.querySelector('.content-wrap'),
         openbtn = document.getElementById('open-button'),
         closebtn = document.getElementById('close-button'),
         isOpen = false;

     function init() {
         initEvents();
     }

     function initEvents() {
         openbtn.addEventListener('click', toggleMenu);
         if (closebtn) {
             closebtn.addEventListener('click', toggleMenu);
         }

         // close the menu element if the target it´s not the menu element or one of its descendants..
         content.addEventListener('click', function (ev) {
             var target = ev.target;
             if (isOpen && target !== openbtn) {
                 toggleMenu();
             }
         });
     }

     function toggleMenu() {
         if (isOpen) {
             classie.remove(bodyEl, 'show-menu');
         } else {
             classie.add(bodyEl, 'show-menu');
         }
         isOpen = !isOpen;
     }

     init();

 })();

How to animate display table to none or zero height?

I am trying to animate a header, when the class collapseTest is added to the header. Came up with the following: http://ift.tt/1fPObZ9 Thanks to @Hackerman for helping me out with the working one.

What I want is, when the class collapseTest is added to the header, the white div with the class top is disappear. Since I use display table instead of block I can't hide the div including the content with the css rule display: none. The content does not disappear.

I use the following animation, that is working for a display block, but not for table.

@-webkit-keyframes pushDown {
    0% {
        height: 50%;
        display: table;
    }
    100% {
        height: 0;
        display: none;
    }
}

I call this one on the div with the class top. Like this:

#header.collapse .top {
    -webkit-animation: pushDown 2s forwards linear;
}

But this isn't working as aspect. Does anyone know what I am doing wrong, why the div with the class top isn't animating to hidden?

Space between List and top of the page

I am using a design I found on a website and it looks really cool but I wanted to alter it to look like what I need it to be.

The original demo looked like this enter image description here

but I needed them to be side by side, so i created a table that was a width of 100% and two columns. I placed both of the lists in the table but something strange happened.

enter image description here

I have checked and there isn't a padding on the top nor is there another object there. The list and table are both set to v-align. I have attached a jFiddle for better reference and help.

JSFiddle

Thank you all so much!

<table width="100%" border="0">
<tbody valign="top">
<tr valign="top">
  <td valign="top">
  <ul class="tabs">
      <li class="tabs__item color1">
        <h2><span>[Review] The New LG G18</span></h2>
        <p class="tabs__stats">Content</p>
      </li>
      <li class="tabs__item color2">
        <h2><span>[ROM][8.3.1] SlimSaber R31</span> </h2>
        <p class="tabs__stats">Content</p>
      </li>
      <li class="tabs__item color3">
        <h2><span>[APP] Goo Simulator Extreme</span></h2>
        <p class="tabs__stats">Content</p>
      </li>
      <li class="tabs__item color4">
        <h2><span>[Tutorial] Pooping Your Pants</span></h2>
        <p class="tabs__stats">Content</p>
      </li>
      <div class="views-toggle views-toggle--hidden">
        <svg fill="white" viewBox="0 0 24 24">
          <path d="M16.59 8.59l-4.59 4.58-4.59-4.58-1.41 1.41 6 6 6-6z"/>
          <path d="M0 0h24v24h-24z" fill="none"/>
        </svg>
      </div>
    </ul>
    <script       src="http://ift.tt/19puDaP"></script> 
    <script src="js/index.js"></script> 
  </td>
  <td valign="top">
  <ul class="tabs">
      <li class="tabs__item color1">
        <h2><span>[Review] The New LG G18</span></h2>
        <p class="tabs__stats">Content</p>
      </li>
      <li class="tabs__item color2">
        <h2><span>[ROM][8.3.1] SlimSaber R31</span> </h2>
        <p class="tabs__stats">Content</p>
      </li>
      <li class="tabs__item color3">
        <h2><span>[APP] Goo Simulator Extreme</span></h2>
        <p class="tabs__stats">Content</p>
      </li>
      <li class="tabs__item color4">
        <h2><span>[Tutorial] Pooping Your Pants</span></h2>
        <p class="tabs__stats">Content</p>
      </li>
      <div class="views-toggle views-toggle--hidden">
        <svg fill="white" viewBox="0 0 24 24">
          <path d="M16.59 8.59l-4.59 4.58-4.59-4.58-1.41 1.41 6 6 6-6z"/>
          <path d="M0 0h24v24h-24z" fill="none"/>
        </svg>
      </div>
    </ul>
    <script src="http://ift.tt/19puDaP"></script> 
    <script src="js/index.js"></script> 
  </td>
 </tr>
 </tbody>
  </table>

How to change polymer 1.0 paper-button color dynamically from an array of colors?

I have an array buttonColors, which has set of colors in the hex format. Now I want to display set of paper-button each with the color present in the buttonColors Array. How to achieve it in polymer 1.0?

<template is="dom-repeat" items="{{buttonColors}}">
      <paper-button style="background-color:{{item}}" >
                  <b>click me</b>
      </paper-button>
</template>

The above snippet does not seem to work. Kindly help.

How to align both these element in same line?

I have a textarea and a `submit button.

Before adding <form> element it looked like

enter image description here

Now, after surrounding those two elements with <form>, it changed to

enter image description here

<div class="input-group">
     <form>
       <input type="text" class="form-control" placeholder="Enter Message"/>
       <span class="input-group-btn" >   
         <button class="btn btn-info" type="submit">SEND</button>
       </span>
     </form>
</div>

How to get back the previous view with the <form> element included?

I am using angular-bootstrap-ui.

I have a custom.css file where I can override the default bootstrap CSS. I tried with ids for form and button, but didn't achieve the exact result. Any help please?

How is typahead searchbar styling added?

Does anyone know how exactly styling is added to the typeahead searchbar?

No matter how I style it, it starts out with default styling, and then switches over to the styling I set after about a second. It does end up where I want it, but it looks terrible to have the styling switching around as the page loads.

It's hard to tell, but I believe it is .twitter-typeahead and tt-input that are the ones moving around.

Is the alternate styling being added somewhere in the javascript? If it were, I would expect the searchbar to start out with my styling, and then be reset by the javascript, not the other way around.

Does anyone know how the styling is being added, or what I can do to stop this effect?

html

<%= form_tag users_path, :method => :get do %>
  <%= text_field_tag :search, params[:search], id:"typeahead" %>
<% end %>

jquery

<script type="text/javascript">
  // app/assets/javascripts/models_controller.js
  // initialize bloodhound engine
  $(document).ready(function(){
    var bloodhound = new Bloodhound({
      datumTokenizer: function (d) {
        return Bloodhound.tokenizers.whitespace(d.value);
      },
      queryTokenizer: Bloodhound.tokenizers.whitespace,

      // sends ajax request to /typeahead/%QUERY
      // where %QUERY is user input
      remote: '/typeahead/%QUERY', 
      limit: 10
    });
    bloodhound.initialize();

    // initialize typeahead widget and hook it up to bloodhound engine
    // #typeahead is just a text input
    $('#typeahead').typeahead(null, {
      maxLength: 10,
      displayKey: function(thing) {
        //...
      },
      source: bloodhound.ttAdapter(),
      templates: { 
            //....
          }
        }
      }
    });
  });
</script>

Overriding slickgrid getItemMetadata cause cell data to blank on select

I'm really not sure what is causing this. I wanted to apply some custom styling to my slickgrid, so I defined a custom getItemMetadata() function and added it to my dataView. At first I thought it was working fine, until I noticed that one some of the cells I apply the styling to, problems appeared.

When I click on the cell-title cell, all is fine, but when I click on any other cell, their data disappears and the cell doesn't change to the 'active' colour. I have another row, which is unselectable, and this problem doesn't appear there. The rows I don't apply any styling to are fine.

My getItemMetadata() function:

function getItemMetaData(row){
    if (grid){
        var rowData = grid.getDataItem(row);
        if(rowData){
            // set the first row unselectable and non-editable class
            if (row == 0  && rowData.isparent){
                return {selectable: false,
                        'cssClasses': "non-editable-row"
                    };
            }
            // set the row non-editable class for certain types
            if(rowData.type == 'foo' || rowData.type == 'barr' ){
                return {'cssClasses': "non-editable-row"};
            }   
        }
    }
    return {};
}

The non-editable-row css class:

div.non-editable-row{
   background-color: #F8F8F8;
}

Has anyone else encountered this?

Dragging through the contents of a DIV with white-space nowrap

I'm wanting to drag through the contents of this DIV. Can this be done with CSS alone?

Basically the functionalty you get from overflow-y: scroll; but I want to hide the scrollbar, and be able to move the contents with a cursor drag and touch drag. How may I do this?

Do no want to use jQuery.

http://ift.tt/1Iz7AJ5

<div class="trusted">
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
</div>

.trusted {
  display: block;
  background: #eee;
  padding: 20px 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

a {
  display: inline-block;
  padding: 10px 0;
  width:100px;
  height:60px;
  background: rgba(0,0,0, .05);
  border-radius: 3px;
  margin:0 10px;
}

Input just working on enter instead of button

i have some issues implementing an form on my newly created project website. i guess the best would be if you could visit the (micro) site and debug there instead i post all my code here. so the link is http://ift.tt/1guDo7C I'm really frustrated at the moment because I'm already over 5 hours working on this bug and cannot figure out where the problem is. Every idea and help is welcom!

Embedded divs in header: css issue

I am trying to create the following structure using embedded divs inside a header:

enter image description here

  • The height and width of the red part is known and fix
  • The height of the green rectangle is known and fix
  • The overall width of the frame can vary, but is never smaller than the red part

I have tried with the following html code:

<header id="header">
  <div id="yellowAndGreen">
      <div id="yellow"></div>
      <div id="green"></div>
  </div>
  <div id="red"></div>
</header>

and the following CSS:

#header {
    width: 400px;  
}
#yellowAndGreen {

}

#yellow {    
    background-color: yelow;
}

#green {    
    background-color: green;
    height: 40px;
}

#red {    
    height: 150px;
    width: 150px;
    background-color: red;
}

but it does not work. I have created a JsFiddle. Can anyone modify it to create what I am looking for?

EasyUI treegrid customize header text

I am trying to center a header text in the above control:

 var td = $(elem).treegrid('getPanel').find('div.datagrid-header td[field="alarms"]');
        td.css('text-align', 'center');
        td.css('height', '40');

The height gets changed to 40, but the text is not aligning.What might the problem be?

Thanks

Whit it? Different results for same code

It's ok ...: http://ift.tt/1MCvQg7

but: http://ift.tt/1MY97Io

Why it? I'm developing a web site, and it's a trouble, a really trouble. kkk'

The code:

<!-- CSS goes in the document HEAD or added to your external stylesheet -->
<style type="text/css">
table.gridtable {
        font-family: verdana,arial,sans-serif;
        font-size:11px;
        color:#333333;
        border-width: 1px;
        border-color: #666666;
        border-collapse: collapse;
}
table.gridtable th {
        border-width: 1px;
        padding: 8px;
        border-style: solid;
        border-color: #666666;
        background-color: #dedede;
}
table.gridtable td {
        border-width: 1px;
        padding: 8px;
        border-style: solid;
        border-color: #666666;
        background-color: #ffffff;
}
</style>
<!-- Table goes in the document BODY -->
<table class="gridtable">
<tr>
        <th>Info Header 1</th><th>Info Header 2</th><th>Info Header 3</th>
</tr>
<tr>
        <td>Text 1A</td><td>Text 1B</td><td>Text 1C</td>
</tr>
<tr>
        <td>Text 2A</td><td>Text 2B</td><td>Text 2C</td>
</tr>
</table>

Why it?

rollover layer hidden behind another layer

I have some icons that have a rollover.

http://ift.tt/1IdDQhl

If you go to the top right and roll over the FB or the TW icons, you will see the rollover shows up like 10 pixels and the rest is behind the grey layer. I cant figure out how to get it to come to the front. I have tried z-index on many different layers and none of them are revealing the full rollover.

Any help would be great.

Thanks! Caroline

Setting Bootstrap buttons to the same width

I have a bootstrap sidebar that contains a couple buttons. Unfortunately, it looks very ugly and I want each button to be the same size. These buttons are contained in a sidebar and will be stack vertically. I want to avoid setting a pixel number for each button.
Here is the jfiddle
http://ift.tt/1JBabmw

HTML

<div id="reading-sidebar" class="col-xs-3 panel-default">
  <div id="reading-sidebar-title" class="panel-heading">Options
    <button type="button" class="btn btn-xs btn-default pull-right" id="reading-sidebar-hide-btn"><i class="glyphicon glyphicon-remove"></i></button>
      </div>
      <div id="reading-sidebar-contents" class="panel-body">
        <ul class="sidebar-button-list">
          <button type="button" id="pre-reading-btn" class="btn btn-default pull-left"><i class="glyphicon glyphicon-minus"></i>&nbsp;Pre Readings</button><br>
          <button type="button" id="passage-btn" class="btn btn-default pull-left"><i class="glyphicon glyphicon-minus"></i>&nbsp;Passage</button><br>
          <button type="button" id="post-reading-btn" class="btn btn-default pull-left"><i class="glyphicon glyphicon-minus"></i>&nbsp;Post Readings</button><br>
          <button type="button" id="media-btn" class="btn btn-default pull-left"><i class="glyphicon glyphicon-minus"></i>&nbsp;Media</button><br>
          <button type="button" id="question-btn" class="btn btn-default pull-left"><i class="glyphicon glyphicon-minus"></i>&nbsp;Questions</button>
        </ul>
      </div>
    </div> 

changed a defined value inside the element

I'm trying to change the defines css inside the div element of embed videos example this is the embed codes for poster

<div class="vjs-poster" tabindex="-1" 
style="background-image: url(streaming-auto-generated-poster.jpg);"></div>

I tried this code but it won't change the background since the default background are defined inside the div

.vjs-poster{
background-image:url(the post thumbnail);
}

what I want is to customized the background-image with my own

Font is displayed differently after migrating to HAML in Rails 4 app

I just migrated my rails app to HAML and since then, my fonts are displayed differently. See the images below for a comparison.

Before: http:///i.imgur.com/x3CjOhE.jpg

After: http://ift.tt/1MzpYmK

I migrated using rake haml:erb2haml included with haml-rails.

If I check out my master branch, it returns to normal. The stylesheets haven't changed and I've confirmed they're loading as normal.

application.html.haml

!!!
%html
  %head
    %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
    %title= full_title(yield(:title))
    = stylesheet_link_tag 'application', media: 'all', |
      'data-turbolinks-track' => true                  |
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
    = render 'layouts/shim'
  %body
    = render 'layouts/header'
    .container
      - flash.each do |message_type, message|
        %div{:class => "alert alert-#{message_type}"}= message
      = yield
    = render 'layouts/footer'
    = debug(params) if Rails.env.development?

application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title><%= full_title(yield(:title)) %></title>
    <%= stylesheet_link_tag 'application', media: 'all',
                                           'data-turbolinks-track' => true %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
    <%= csrf_meta_tags %>
    <%= render 'layouts/shim' %>
  </head>
  <body>
    <%= render 'layouts/header' %>
      <div class="container">
        <% flash.each do |message_type, message| %>
          <div class="alert alert-<%= message_type %>"><%= message %></div>
        <% end %>
        <%= yield %>
      </div>
    <%= render 'layouts/footer' %>
    <%= debug(params) if Rails.env.development? %>
  </body>
</html>

Can anybody shed some light on why this might be happening?

My site only works on Safari. Broken on Chrome / IE / Firefox [on hold]

Hello programmers / web designers,

My site has been working flawlessly for some time and now all of a sudden it is broken on Chrome / IE / and firefox. It looks perfectly fine on Safari.

I am desperate for help as my business is now suffering because of it. It is a shopify site with the stock shopify theme Launchpad that I heavily edited myself. I am not the best developer and my code is kind of messy.

centering a navbar when screen resizes.

I am trying to centre my navbar, after my screen resizes to a smaller size. I have made sure that my class containing my navigation: .menu has the following display: inline-block; margin: 0px auto;

it still doesn't centre...

However, my logo contained in the div above, has the same properties and it is able to centre when the screen resizes.

Can anybody give me some insight?

Putting title on top of

I am green at HTML, so I am having a bit of difficulty figuring out how to place a label on top of addressBookWidgetDivthat says Select Shipping Address and one top of the walletWidgetDiv that says Select Payment Method. So far everything I have tried puts the text between the 2 boxes, of course, I needed on top. I tried using p and h1 tags with no luck.

These to elements show side by side.

<div style="width: 100%; display: table;">
    <div style="display: table-row">
        <div id="addressBookWidgetDiv" style="width:400px; height:240px; padding-top: 50px;display: table-cell;"> Left </div>         
        <div id="walletWidgetDiv" style="width:400px; padding-left:10px; padding-top: 50px;height:240px;display: table-cell;"> Right </div>
    </div>
</div>

Any ideas? I am new at this so if this is elemental, please forgive.

Thanks.

Skrollr - Middle Section to stop and rotate elements

This is my requirement (Also see image http://ift.tt/1VRO1Sa for visual):

1) Say 4 sections:

div 01 div 02 div 03 div 04

2) My second div02 has an element which needs to translate, post the div02 reaches center of page. Scrolling stopped, just animation happening as user is scrolling. (position fixed i assume)

3) After translation is complete, the scrolling needs to continue, as usual, and all div's move up.

Any help, on how to get this done? I have been trying to shuttle between position relative to fixed at data-center, but not getting the feel.

Thanks!

install and configure sass and compass to use with the foundation

Good installed foundation 5 just downloading and copying files

Now to move on veriaveis the need fondation have a .scss file however does not have anything on my Symfony2 project to use them

config.yml

filters:
        cssrewrite: ~
        compass: ~
        sass: ~

base.html.twig

{% stylesheets "bundles/delivveweb/scss/*" filter="compass" %}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

he is generating the css file however when you open the file contains the following error:

[exception] 500 | Internal Server Error | Assetic\Exception\FilterException
[message] An error occurred while running:
'/usr/bin/ruby' '/usr/bin/compass' 'compile' '/tmp' '--boring' '--config' '/tmp/assetic_compassl2wvYW' '--sass-dir' '' '--css-dir' '' '/tmp/assetic_compassH8m6D9.scss'

Error Output:
/usr/bin/ruby: No such file or directory -- /usr/bin/compass (LoadError)

I hope someone can help me install it, if it were possible using composer

Using :after pseudoelement with :required pseudoclass

Pardon me if this question is already answered, but I couldn't find it.

I am trying to put an asterisk after all <input required> elements.

I found that I can style these with the :required selector.

I would like to use the :after pseudoelement to add an asterisk.

My CSS:

*:required:after {
    content:"*";
    font-size:48px;
    color:red;
    position:relative;
    top:9px;
}

In Opera 30 and Chrome 40, I see this (note that nearly all of these have the required attribute, see code below.):

A Pseudoclass's Pseudoelement

In Firefox 39, no pseudoelements are displayed. Why is it that the pseudoelement only displays on the <input type="date"/> and not on any of the other inputs or selects? And, more importantly, how can I make it display on all required elements?

I'm using bootstrap3 and jquery, if that matters.

HTML:

<label>Title 
    <select name="title" id="title" class="form-control" required> <!-- Trigger Gender here I think... -->
        <option value="Mr.">Mr.</option>
        <option value="Mrs.">Mrs.</option>
        <option value="Miss">Miss</option>
        <option value="Ms.">Ms.</option>
        <option value="Dr.">Dr.</option>
        <option value="Rev.">Rev.</option>
    </select>
</label>
<label>First Name (as on Passport)  <input type="text" name="firstName" id="firstName" placeholder="Charles" class="form-control" required/></label>
<label>Last Name (as on Passport)   <input type="text" name="lastName" id="lastName" placeholder="Studd" class="form-control" required/></label>
<label>Maiden Name (if applicable)  <input type="text" name="maidenName" id="maidenName" class="form-control"/></label>
<label>Other Names                  <textarea name="aliases" id="aliases" placeholder="C. T. Studd" class="form-control"></textarea></label>
<label>Date of Birth                <input type="date" name="birthday" id="birthday" class="form-control" placeholder="12/02/1860" required/></label>
<label>Gender Autofilled
    <select name="gender" id="gender" class="form-control" required>
        <option value="male">Male</option>
        <option value="female">Female</option>
    </select>
</label>

Drop down inline menu troubleshoot

Hi im trying to create an inline drop-down menu but when i add the css code to my styles sheet all the items fall on top of each other.

Could anyone please help with this?

CSS align fullscreen image with max-height to middle

I am trying to create a simple gallery-like image viewer and I want to align the image to the centre and middle of the page.

This can be done simply using table and table-row, but only in the case when the image is smaller than 100% of the page. In the second case, I am able to align it simply through text-align: centre and max-height: 100% (see http://ift.tt/1IdvMgy).

But how to get it working in both cases?

How do I have code in a block in HTML while not having to remove all indentation in my HTML?

I have the following HTML:

<body>
    Here is some code:

    <pre><code>
        Here is some fun code!    
    </code></pre>
</body>

But when I preview it, because the code is indented, the pre is all out of whack. I can fix that by bringing the contents back against the indent, but it looks silly. Can I make that above text look non-indented?

Here's a fiddle: http://ift.tt/1MzjCUu

HeyHo, i´m trying to make a responsive Webside where the "head" "nav" "footer" is in normal alignment (left) and the "section" [the thing with the Green and Blue color] is in the center. The Code: [I think when i show the whole code, then you can retrace it better.]

@import url("font-awesome.min.css");
@import url("http://ift.tt/1bSiS9T");
@import url("http://ift.tt/OIiP2w");

header, nav, aside, section, footer
{
        display: block;
}

body
{
        font-family: 'Open Sans', sans-serif;
        background: #f0f0f0;
        font-weight: 300;
}

header
{
        background-color:yellow;
}

nav
{
        background-color:orange;
}

section
{
        background-color:yellowgreen;
        width: 80%;
        display: inline-block;
}

footer
{
        background-color:deepskyblue;
}

article
{
        background-color:red;
}

aside
{
        background-color:blue;
        width: 20%;
    float: right;
}

#mid
{
    margin: 0 auto;
}
<!DOCTYPE html>
<html>
<head>
        <title>The Title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="style.css">
        <script>
                document.createElement("header");
                document.createElement("nav");
                document.createElement("aside");
                document.createElement("section");
                document.createElement("footer");
        </script>
</head>
<body>
        <header>
                I´m the Header
        </header>
        <nav>
                Navigation
        </nav>
        <section id="mid">
                <aside>
                        The Sidebar
                </aside>
                <p>Text!</p>
                <p>2nd Text</p>
        </section>
        <footer>
                &copy; Unknown | Desing: ME
        </footer>
        
</body>
</html>

Now. I am Trying to put the in the middle. I tried it with extra "div"´s, instead of the "section id=mid" with "class" and others. But The Text in the "section" should be "left", thats why i don´t use < "center" > I tried to search in the index of stackoverflow but nothing worked. The only thing thats moving ist the width in many times to 50%.

Can anyone reseach the fail in the code? Thanks!

tr:last-child selector does not work

I've rather complex cascade around themed components rendered by C#/Razor code within MS MVC framework, but anyway: according info I'm able reveal in browsers (Firefox 39.0, Chrome 44.0.2403.125 m) there is something strange what I'm not able understand:

I have a selector:

table.Theme-DataGrid-Table tr.Theme-DataGrid-Row td  

and it works as expected. But if I added last-child selector

table.Theme-DataGrid-Table tr:last-child.Theme-DataGrid-Row td  

nor

table.Theme-DataGrid-Table tr.Theme-DataGrid-Row:last-child td  

the show stops and previously selected style disappears from all td elements including the last row even if the last row has still the same class - in browsers's bread-crumbs can be seen:

tr#unitorder_9.Theme-DataGrid-Row.Theme-DataGrid-ItemCss

Pls, does does anybody know what I'm missing?

Thanx, pf

UPDATE1 The code above is actually shown in pop-up jQuery dialog and loaded as partial view into base page DOM. If I copy div container element and all its content from Browser to Fiddler and supply corresponding .css styles, then :last-child selector works.

Could be possible that it depends on the fact, that HTML code of poped-up dialog lives within DOM object of complex basal page?

Filtering with jQuery Isotope leads to jerky animation

I'm using Isotope on a project, but have run into an issue when using the filter method.

Filtering the list hides the undesired elements fine, but the transitioning animations aren't as smooth as the demos have me believe they should be.

The following code should illustrate my point; the filters apply and the elements do animate, but there are noticeable, visual jumps:

var config = {
    itemSelector: '.grid_item',
    percentPosition: true,
    layoutMode: 'fitRows',
    fitRows: {
        gutter: '.grid_gutter'
    }
}

$('.grid').isotope(config);

$('.filter').on('click', function(){
    var type = $(this).attr('id');
    $('.grid').isotope({
        filter : '.' + type
    });
});

$('#clear').on('click', function(){
    $('.grid').isotope({
        filter : '*'
    });
});
html, body {
    margin: 0;
    padding: 0;
}

.grid {
    list-style: none;
    margin: 1em;
    padding: 0;
    text-indent: 0;
}

.grid_item {
    background: gray;
    margin: 0 0 1%;
    padding-top: 40%;
    position: relative;
    width: 49.5%;
}

.grid_text {
    color: #fff;
    position: absolute;
    top: 50%; left: 0; right: 0; bottom: 0;
    text-align: center;
}

.grid_gutter {
    width: 1%;
}
<script src="http://ift.tt/1oMJErh"></script>
<script src="http://ift.tt/1MzjzYT"></script>

<button class="filter" id="exit">Exit</button>
<button class="filter" id="creation">Creation</button>
<button id="clear">Clear</button>

<ul class="grid">
    <div class="grid_gutter"></div>
    <li class="grid_item exit">
        <span class="grid_text">Exit</span>
    </li>
    <li class="grid_item creation">
        <span class="grid_text">Creation</span>
    </li>
    <li class="grid_item creation">
        <span class="grid_text">Creation</span>
    </li>
</ul>

I assume that it's something in my CSS that's causing the issue, but I can't weed it out.

Also, see this fiddle.