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?
- CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page
- CSS: Creating textured backgrounds
- How to set String’s font size, style in Java using the Font class?
- Why doesn’t min-height not work on my page?
- How to position a table at the center of div horizontally & vertically
- In a bootstrap responsive page how to center a div
- How to add stylesheets only to pages with specific shortcode?
- How to work with custom styles saved in theme option?
- Modernizr and WordPress – How can I add a CSS class to the html element?
- Adding inline styles from a widget
- Remove Genericons Helper CSS from twentyfourteen theme
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Different ways to load child theme css
- Style internal links based on the tags of the linked post
- How to override Bootstrap css with my child theme css in wordpress?
- How to stop Gutenberg from outputting inline CSS for specific blocks?
- Inside a loop, how to change CSS class based on category name?
- Change CSS based on is_user_logged_in
- How to know which order WordPress places CSS files?
- Place title (in correct place) above image with opaque background [closed]
- Centering one product on a single page [closed]
- Overwriting forced wordpress CSS styles [closed]
- Styling an “active” link outside of WordPress default menu
- How to separate each individual blog post?
- WordPress sidebar content moving to bottom of page
- Making the menu toggled open on mobile devices Illustratr theme
- How to Compress Css/js code in wordpress and increase loading speed?
- Change site title color on individual pages
- Adding a css style to the main nav menu in child pages
- Help with changing style of the extended menu drop down [closed]
- Stop underlining image links
- Enqueue MCE Editor CSS in admin page