How to position a div in the middle of the screen when the page is bigger than the screen

just add position:fixed and it will keep it in view even if you scroll down. see it at http://jsfiddle.net/XEUbc/1/ #mydiv { position:fixed; top: 50%; left: 50%; width:30em; height:18em; margin-top: -9em; /*set to a negative number 1/2 of your height*/ margin-left: -15em; /*set to a negative number 1/2 of your width*/ border: 1px solid #ccc; background-color: … Read more

Can I define a class name on paragraph using Markdown?

Dupe: How do I set an HTML class attribute in Markdown? Natively? No. But… No, Markdown’s syntax can’t. You can set ID values with Markdown Extra through. You can use regular HTML if you like, and add the attribute markdown=”1″ to continue markdown-conversion within the HTML element. This requires Markdown Extra though. <p class=”specialParagraph” markdown=’1′> … Read more

How to hide collapsible Bootstrap navbar on click

Update 2021 – Bootstrap 5 (beta) Use javascript to add a click event listener on the menu items to close the Collapse navbar.. const navLinks = document.querySelectorAll(‘.nav-item’) const menuToggle = document.getElementById(‘navbarSupportedContent’) const bsCollapse = new bootstrap.Collapse(menuToggle) navLinks.forEach((l) => { l.addEventListener(‘click’, () => { bsCollapse.toggle() }) }) BS5 demo javascript method Or, Use the data-bs-toggle and … Read more

How to vertically center inside the parent element with CSS? [duplicate]

The best approach in modern browsers is to use flexbox: #Login { display: flex; align-items: center; } Some browsers will need vendor prefixes. For older browsers without flexbox support (e.g. IE 9 and lower), you’ll need to implement a fallback solution using one of the older methods. Recommended Reading Browser support A Guide to Flexbox … Read more

CSS background-image – What is the correct usage?

The path can either be full or relative (of course if the image is from another domain it must be full). You don’t need to use quotes in the URI; the syntax can either be: background-image: url(image.jpg); Or background-image: url(“image.jpg”); However, from W3: Some characters appearing in an unquoted URI, such as parentheses, white space … Read more

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