Add stroke effect to DIV border in CSS

sarash
 
on May 02, 2021 10:42 PM
2375 Views

Hello

I define div on-page and I want to put a stroke on the border of div below are codes:

.path {
    width:500px;
    height:200px;
    border:5px solid red;
    stroke:red;
}

but it doesn't work

possible please write code for both border and outline

can you help me?

Thanks in Advanced

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on May 03, 2021 02:13 AM
on Jan 13, 2022 09:57 AM

Hi sarash,

Use outline property.

Refer below code.

HTML

<html>
<head>
<style>
    .path 
    {
          width:500px;
          height:200px;
          border: 5px solid black;
          outline: red solid 5px;
          text-align: center;
    }
</style>
</head>
<body>
    <div class="path">Welcome to ASPSnippets.com.</div>
</body>
</html>

Demo

sarash
 
on May 03, 2021 04:52 AM

hi Dharmendr

I know the codes that you wrote but I thought Stroke is different from Border so what are these codes?