Get the size of the screen, current web page and browser window

You can get the size of the window or document with jQuery: // Size of browser viewport. $(window).height(); $(window).width(); // Size of HTML document (same as pageHeight/pageWidth in screenshot). $(document).height(); $(document).width(); For screen size you can use the screen object: window.screen.height; window.screen.width;

How do I give text or an image a transparent background using CSS?

Either use a semi-transparent PNG or SVG image or use CSS: background-color: rgba(255, 0, 0, 0.5); Here’s an article from css3.info, Opacity, RGBA and compromise (2007-06-03). Beware that the text still needs sufficient contrast with the background, once the underlying background shines through. <p style=”background-color: rgba(255, 0, 0, 0.5);”> <span>Hello, World!</span> </p>

How do I create an HTML button that acts like a link?

HTML The plain HTML way is to put it in a <form> wherein you specify the desired target URL in the action attribute. <form action=”https://google.com”> <input type=”submit” value=”Go to Google” /> </form> If necessary, set CSS display: inline; on the form to keep it in the flow with the surrounding text. Instead of <input type=”submit”> … Read more

Make a div fill the height of the remaining screen space

2015 update: the flexbox approach There are two other answers briefly mentioning flexbox; however, that was more than two years ago, and they don’t provide any examples. The specification for flexbox has definitely settled now. Note: Though CSS Flexible Boxes Layout specification is at the Candidate Recommendation stage, not all browsers have implemented it. WebKit … Read more

How to make a div 100% height of the browser window

There are a couple of CSS 3 measurement units called: Viewport-Percentage (or Viewport-Relative) Lengths What are Viewport-Percentage Lengths? From the linked W3 Candidate Recommendation above: The viewport-percentage lengths are relative to the size of the initial containing block. When the height or width of the initial containing block is changed, they are scaled accordingly. These … Read more

I need an unordered list without any bullets

You can remove bullets by setting the list-style-type to none on the CSS for the parent element (typically a <ul>), for example: ul { list-style-type: none; } You might also want to add padding: 0 and margin: 0 to that if you want to remove indentation as well. See Listutorial for a great walkthrough of … Read more

How can I know which radio button is selected via jQuery?

To get the value of the selected radioName item of a form with id myForm: $(‘input[name=radioName]:checked’, ‘#myForm’).val() Here’s an example: $(‘#myForm input’).on(‘change’, function() { alert($(‘input[name=radioName]:checked’, ‘#myForm’).val()); }); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <form id=”myForm”> <fieldset> <legend>Choose radioName</legend> <label><input type=”radio” name=”radioName” value=”1″ /> 1</label> <br /> <label><input type=”radio” name=”radioName” value=”2″ /> 2</label> <br /> <label><input type=”radio” name=”radioName” value=”3″ /> … Read more

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