There’s an experimental CSS property called text-stroke, supported on some browsers behind a -webkit prefix.
h1 {
-webkit-text-stroke: 2px black; /* width and color */
font-family: sans; color: yellow;
}
<h1>Hello World</h1>
Run code snippetExpand snippet
Another possible trick would be to use four shadows, one pixel each on all directions, using property text-shadow:
h1 {
/* 1 pixel black shadow to left, top, right and bottom */
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
font-family: sans; color: yellow;
}
<h1>Hello World</h1>
Run code snippetExpand snippet
But it would get blurred for more than 1 pixel thickness.
Related Posts:
- How to import Google Web Font in CSS file?
- CSS reset – What exactly does it do?
- When to use margin vs padding in CSS [closed]
- SVG center horizontal and vertical line
- Can I change Bootstrap button color?
- Is it bad practice to comment out single lines of CSS with //?
- How to draw a half circle (border, outline only) [closed]
- CSS Circle with border
- Set parent style via child
- What is the proper way to display a logo with CSS?
- Responsive font size in CSS
- How to make a vertical line in HTML
- How do I change the background color with JavaScript?
- Why em instead of px?
- Vertical Align Center in Bootstrap
- Button Center CSS
- Centering a background image, using CSS
- How to change the cursor into a hand when a user hovers over a list item?
- not:first-child selector
- CSS: center element within a element
- what is a parse error and how do I fix it
- Bootstrap NavBar with left, center or right aligned items
- How to make the overflow CSS property work with hidden as value
- How to make a sticky footer in react?
- How to push a footer to the bottom of page when content is short or missing?
- Linking to a pdf file with html
- Can I add background color only for padding?
- Change TD border color with HTML or CSS
- Why adding version number to CSS file path?
- Hide text using css
- Changing the width of Bootstrap popover
- CSS background color not working
- Bootstrap transparent navbar
- How do I install a custom font on an HTML site
- jQuery toggle CSS?
- 100% DIV width is not really 100%
- CSS 3 slide-in from left transition
- CSS selectors ul li a {…} vs ul > li > a {…}
- Bootstrap scrollable panel
- CSS checkbox input styling
- Is there a CSS selector for elements containing certain text?
- Failed to decode downloaded font
- How to place two divs next to each other?
- Background color in input and text fields
- How can I change the Bootstrap default font family using font from Google?
- CSS3 opacity gradient?
- CSS3 background image transition
- Set line height in Html
to make the html looks like a office word when
has different font sizes
- CSS Equivalent of the “if” statement
- font-weight is not working properly?
- How to make div background color transparent in CSS
- Changing code font size on wordpress
- Lucida calligraphy font not working wordpress site in android chrome
- @font-face doesn’t work
- How to add custom fonts in WordPress site
- How to remove google font in WordPress for only single page?
- How to set different font family based on text language?
- Where Do I Find The Astra Default Font Family That All Text Elements Are Inheriting From? [closed]
- Font Awesome 5 Free – far working but fas is not? [closed]
- How to access theme fonts using custom CSS style? [closed]
- How would one set or override a Fallback font for characters in second language?
- I have a wordpress website which uses a really weird font on Opera. What do I need to do to fix it?
- Font .woff files loaded don’t correspond to the displayed styles [closed]
- When changing theme’s font, why does font-size attribute not work? [duplicate]
- Fonts are not applying
- Fonts are parsed in one way but rendered in a different way
- Custom font isn’t active on all PCs
- Disable all Fonts that are Standard in WordPress and replacing them with a custom Font?
- How to set up fixed width for
? - How do I make a placeholder for a ‘select’ box?
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- CSS3 Rotate Animation
- Is it possible to define constants in CSS?
- How to make fixed header table inside scrollable div?
- How to conditionally enqueue a stylesheet only for a certain page(s)?
- Why does wp_enqueue_style() in plugin not load stylesheet?
- Is there a quick way to remove inline css from all posts?
- How to make a theme with more than one CSS file?
- How to remove CSS file in the header using WordPress functions?
- The style.css stylesheet doesn’t contain a valid theme header
- Using PHP in a Stylesheet (possibly a “.htaccess” problem?)
- Override load-styles.php with admin screen css
- Using PIE CSS in WordPress. “localizing” styles
- Dynamic sidebar nav with current page highlighting
- WordPress plugin output formatting
- Adding custom styles to elements, without creating new elements
- How to Style Primary Menu with Active Class
- How can I wrap all blog posts image with
- Hiding Label via CSS
- How to remove sidebar primary widget on Mobile on category page [closed]
- Display post formats differently on index.php (loop in function)
- How to get sub-categories to display same look as there parents
- Online wc-blocks-style.css rendering instead of the hosted wc-blocks-style.css
- removing side space between para and container on generatepress?
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- How to remove Google fonts from wp-admin (Roboto) added by core
- I can not change the background-color value of wp: meta_value of content.xml
- How to automatically add custom classes to headings in content area
- Can’t style custom menu