Recommended Free Tools
Use the CSS border shorthand to set an element’s border width, line style, and color: border: 1px solid #333;. The line style is essential: if it is omitted, the style defaults to none, so a declared width and color alone will not display a border.
Set a border on all four sides
The border shorthand applies to the top, right, bottom, and left sides. It accepts width, style, and color in any order:
.card {
border: 1px solid #333;
}
Here, 1px is the width, solid is the line style, and #333 is the color. The width and color are optional when a style is provided: an omitted width defaults to medium, and an omitted color defaults to currentColor. But if you omit the style, it defaults to none, and the border is not drawn. See MDN’s border reference.
Choose a line style and set different sides
Common values for border-style include solid, dotted, dashed, double, groove, ridge, inset, and outset. For example, a card can have a solid top edge and a dashed bottom edge:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
.card {
border-top: 2px solid #333;
border-bottom: 1px dashed #999;
}
Side shorthands such as border-top set width, style, and color for that side. You can also use individual properties such as border-top-width, border-top-style, and border-top-color. For logical, writing-direction-aware sides, use properties such as border-inline-start.
Use one to four values for all side styles
The number of values in border-style determines how they map to sides:
Rank #2
- One: all four sides.
- Two: top and bottom, then left and right.
- Three: top, left and right, then bottom.
- Four: top, right, bottom, left.
.card {
border-style: solid dashed dotted double;
}
In that example, the sides are solid, dashed, dotted, and double in clockwise order. The exact dash-segment length and dot spacing are not specified, so their appearance can vary by browser. For property details, see MDN’s border-style reference.
Round corners with border-radius
Set border-radius to round all corners, or provide multiple values to control corners individually:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Rank #3
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
.card {
border: 1px solid #ccc;
border-radius: 8px;
}
Lengths and percentages are supported. A single radius applies to all corners; multiple radii allow different corners, and elliptical radii can use separate horizontal and vertical values. For percentage radii, the horizontal component is relative to the box width and the vertical component to its height. See MDN’s border-radius reference.
Understand how borders affect element size
A border sits between padding and margin. Whether it adds to the element’s outside dimensions depends on box-sizing:
Rank #4
- With the standard
content-boxmodel, declared width and height describe the content box. Border thickness adds to the outside dimensions, along with padding. - With
border-box, the declared width and height include the content, padding, and border. A thicker border uses more of those declared dimensions instead of expanding the outside size.
If adding a border unexpectedly changes a layout, check the element’s computed box-sizing as well as its width and padding. The box-model explanation is in MDN’s CSS box model guide.
Choose between a border and an outline
A border is part of the box and affects its dimensions. An outline is drawn outside the border and does not take up layout space, which makes it useful for showing keyboard focus without shifting nearby content. Outlines are not necessarily rectangular in every case.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteBest Value
a:focus-visible {
outline: 3px solid #1769aa;
outline-offset: 3px;
}
Do not remove an interactive element’s focus outline with outline: none or outline: 0 unless you provide an equally obvious visible focus treatment. See MDN’s outline reference.
Troubleshoot a border that does not appear
- Check the style first. A declaration such as
border: 2px #333leaves the style atnone. Add one, for exampleborder: 2px solid #333. - Check the selector and cascade. Confirm the rule matches the intended element and that another rule does not override its border or border style.
- Check side-specific declarations. A later shorthand or longhand can change the side you are trying to show. Inspect the computed styles in your browser’s developer tools.
- Check visibility and color. Verify the element is rendered and that the border color contrasts with its background.
- Check box sizing if dimensions changed. The border may be visible but enlarge an element using the standard content-box model.
Or skip the browser setup
For a rendered page screenshot, ScreenshotNeo takes a screenshot with one GET request. For example, this cURL command saves the result as a WebP file:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Before capture, it accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server offers screenshot and page-info tools for AI agents. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




