jQuery: Get selected element tag name

You can call .prop(“tagName”). Examples: jQuery(“<a>”).prop(“tagName”); //==> “A” jQuery(“<h1>”).prop(“tagName”); //==> “H1” jQuery(“<coolTagName999>”).prop(“tagName”); //==> “COOLTAGNAME999” If writing out .prop(“tagName”) is tedious, you can create a custom function like so: jQuery.fn.tagName = function() { return this.prop(“tagName”); }; Examples: jQuery(“<a>”).tagName(); //==> “A” jQuery(“<h1>”).tagName(); //==> “H1” jQuery(“<coolTagName999>”).tagName(); //==> “COOLTAGNAME999” Note that tag names are, by convention, returned CAPITALIZED. If … Read more

Targeting only Firefox with CSS

OK, I’ve found it. This is probably the cleanest and easiest solution out there and does not rely on JavaScript being turned on. @-moz-document url-prefix() { h1 { color: red; } } <h1>This should be red in FF</h1> It’s based on yet another Mozilla specific CSS extension. There’s a whole list for these CSS extensions … Read more

How do you easily horizontally center a using CSS? [duplicate]

In the case of a non-fixed width div (i.e. you don’t know how much space the div will occupy). #wrapper { background-color: green; /* for visualization purposes */ text-align: center; } #yourdiv { background-color: red; /* for visualization purposes */ display: inline-block; } <div id=”wrapper”> <div id=”yourdiv”>Your text</div> </div> Keep in mind that the width … Read more

Change navbar color in Twitter Bootstrap

tl;dr – TWBSColor – Generate your own Bootstrap navbar Version notes: Online tool: Bootstrap 3.3.2+ / 4.0.0+ This answer: Bootstrap 3.0.x For Bootstrap 5.x, please check documentation Available navbars You’ve got two basic navbars: <!– A light one –> <nav class=”navbar navbar-default” role=”navigation”></nav> <!– A dark one –> <nav class=”navbar navbar-inverse” role=”navigation”></nav> Default color usage … Read more

Text-align class for inside a table

Bootstrap 3 v3 Text Alignment Docs <p class=”text-left”>Left aligned text.</p> <p class=”text-center”>Center aligned text.</p> <p class=”text-right”>Right aligned text.</p> <p class=”text-justify”>Justified text.</p> <p class=”text-nowrap”>No wrap text.</p> Bootstrap 4 v4 Text Alignment Docs <p class=”text-xs-left”>Left aligned text on all viewport sizes.</p> <p class=”text-xs-center”>Center aligned text on all viewport sizes.</p> <p class=”text-xs-right”>Right aligned text on all viewport sizes.</p> … Read more

How to apply multiple transforms in CSS?

You have to put them on one line like this: li:nth-child(2) { transform: rotate(15deg) translate(-20px,0px); } When you have multiple transform directives, only the last one will be applied. It’s like any other CSS rule. Keep in mind multiple transform one line directives are applied from right to left. This: transform: scale(1,1.5) rotate(90deg); and: transform: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)