User-select property – prevent text selection To prevent text selection, you can add CSS: p { -webkit-user-select: none; /* Safari */ -ms-user-select: none; /* IE 10 and IE 11 */ user-select: none; /* Standard syntax */ } on specific class .prevent-select {-webkit-user-select: none; /* Safari */ -ms-user-select: none; /* IE 10 and IE 11 */ […]
Category: CSS
CSS Comma-separated list
Comma-separated list Here’s a neat little trick that allows you to create a comma-separated list using just an HTML unordered list and a couple of lines of CSS. ul > li:not(:last-child):after { content: “, “; } In order for this to work you need to make sure to set the display property of the li tag to inline-block. <ul> <li>First […]
CSS External links
1. External links Styling external links can be done in several ways. One way to do this is by adding an extra class to all the external links. This is cumbersome and unnecessary since this can be done very easily by only using CSS. Let’s take a look at the following selector. a[href*=”//”]:not([href*=”yourwebsite.com”]) { /* […]
add external link icon before link
a[href*=”//”]:not([href*=”yourwebsite.com”]) { /* Apply style here */ } This CSS selector takes all a tags which href attribute contains two forward slashes (to filter out relative URLs) and which doesn’t contain the URL of your website. article
Create responsive image
Wrap image with relative padded parent. Keep image ratio with percentage on the padding property. Image is full size absolute child.
Add Custom CSS to WordPress Admin
Step 1: Create Your CSS File You can place the CSS file wherever you’d like; I’ve chosen to place the CSS file within my theme. My admin CSS file looks like: The CSS above makes tags more visible. It also will make any PRE element without a class more apparent, teling me I need to […]
Add Submenu to WordPress Admin Bar
add to functions.php Setting an id on parent menu item allows parent key for submenu items https://davidwalsh.name/add-submenu-wordpress-admin-bar By David Walsh on January 6, 2015
Center headline vertically
Add custom css file in theme
A list of everything that could go in the of your document
HEAD A list of everything that could go in the <head> of your document Table of Contents Recommended Minimum Elements Meta Meta: Not Recommended Link Link: Not Recommended Favicons Social Facebook / Open Graph Facebook / Instant Articles Twitter Google+ / Schema.org OEmbed Browsers / Platforms Apple iOS Apple Safari Google Android Google Chrome Microsoft […]