Tag: css

When to use the css element/class selector in javascript?

I’m currently working on the codecademy course on building an interactive website and I stumbled upon an ambiguity concerning the use of the elemement/class selection of the css elements. javascript: var main = function() { $(‘.article’).click(function() { $(‘.article’).removeClass(‘current’); $(‘.description’).hide(); $(this).addClass(‘current’); $(this).children(‘.description’).show(); }); }; css: .current .item { background: rgba(206,220,206,.9); } Why do I have to […]

Twitter-Bootstrap respond.js not working for IE8

I’m still having some problems getting my Twitter-Bootstrap page to display the desktop view correctly in IE8. I’ve been following a few threads here but the voted up advice is just not working for me. Using the suggested meta tag <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> Included local versions of bootstrap.css, html5shiv.js, respond.js, ie8-responsive-file-warning.js Here is my head […]

Adding a class to img tags using JavaScript

I am a learning javascript guy and I am trying to add the Image Hover Shadow Effect With CSS to my images and for that to work , I have to add an class to all my img tags , which is not possible manually so i am trying to write a javascript that does […]

How to add CSS class dynamically to html element

I am new to the Javascript and especially to angularJS so maybe my question wil seem naive to some. I am working on my angularJS tutorial project. I have this HTML rows: <link href=”http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css” rel=”stylesheet”/> <link href=”http://acornejo.github.io/bootstrap-nav-wizard/bootstrap-nav-wizard.css” rel=”stylesheet”/> <link href=”http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css” rel=”stylesheet”/> <body> <div class=”container”> <ul class=”nav nav-wizard”> <li class=”active”><a href=”#”>Step1</a></li> <li><a href=”#”>Step2</a></li> <li><a href=”#”>Step3</a></li> </ul> […]

Is there a javascript equivalent to using @media query?

This question already has an answer here: How to use javascript conditionally like CSS3 media queries, orientation? 5 answers

Getting width of an element defined in CSS in em

I am having trouble getting the width of an element defined in CSS. I figured out how to get the CSS rules using Javascript, but I can’t access the width. Menu is fixed width that I defined in CSS using em. I am trying to change the width of the div1 based on the browser […]

Is there a way to highlight the target of a bookmark? (www.site.com/page.htm#bookmark)?

I want to link to bookmark on a page (mysite.com/mypage.htm#bookmark) AND visually highlight the item that was bookmarked (maybe having a red border). Naturally, there would be multiple items bookmarked. So that if someone clicked on #bookmark2 then that other area would be highlighted). I can see how to do that with .asp or .aspx […]

HTML blank I want to erase

I have a new problem that bugs me … I am making a web page that I want to be fixed with no scrolling and most important I want my main Div to fill aaaaaaaaall my available space… I made this code <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:v=”urn:schemas-microsoft-com:vml”> <head> <title>There […]

What the difference between classes with space and no space in css, what the use of multiple classes with no space

I am making an accordion using CSS, the below is my use of CSS class without space. I use this to eliminate the animation of padding during slideDown and slideUp effect .acc_container.block{ padding: 20px; } since it stated out that padding is 20 pixels but when i check it seems like no padding at all!! […]

Onclick remove appended Div – JQuery

How to remove the appended row, when click on “X” button of a specific Div. Here is the JsFiddle DEMO: http://jsfiddle.net/7jE9p/4/ I am providing CODE here too: HTML: <p> <a href=”javascript:void(0);” class=”add_more”>Add More</a> </p> <table border=”0″ width=”500″ cellspacing=”0″> <tbody class=”append_data”></tbody> <tr> <td> <textarea name=”description” id=”description”></textarea> </td> </tr> </table> CSS: #description{ width:400px; } .description_text{ border:#333333 solid […]