Stack Overflow for Teams is a private, secure spot for you and
Free 30 Day Trial
Stack Overflow works best with JavaScript enabled
In this example I have a dotted line of 1px dots and 2px spacing. Those long straight lines draw your eye and hold your attention. The The two stops are defined such that the dot is nice and smooth: solid black for half the radius and than a gradient to the full radius.This is a really old question but it has a high ranking in Google so I'm going to throw in my method which could work depending on your needs.In my case, I wanted a thick dashed border that had a minimal break in between dashes.
I ended up with a 20px by 2px repeated dash, 18px of that being solid line and 2px white.
The effect depends on the border-color value: Play it » ridge: Specifies a 3D ridged border. Supply a value in the Dash and Gap fields. Check it out at I can't imagine what a pain in the a** that would be to maintain. It is therefore possible to have different length dashes on each border side.Apart from those choices, there is no way to influence the standard border's style.If the possibilities there are not to your liking, you Building 4 edges solution basing on @Eagorajose's answer with shorthand syntax:This is an old, but still very relevant topic.
The outer box just needs to be relatively positioned.Note: i used tachyons in this example, but i guess the classes are kind of self-explanatory.This will make an orange and gray border using the class="myclass" on the div.Thanks for contributing an answer to Stack Overflow! Should be marked as the solution...thanks pekka, that mean i can't use border property ... so i have to use image for it. Long dashes — what grammarians call em dashes — are dramatic.
They are described below: Method 1: Using SVG. The Overflow Blog
This way you can have multiple dotted borders too using multiple backgrounds.Here's a trick I've used on a recent project to achieve nearly anything I want with horizontal borders. I stored my image as a SASS variable so I could reuse it in my site.So many people are say "You can't". It can also be set with a pixel value, percentage value, or as another multiple (1x, 2x, 3x etc). Even the accepted answer only works for one edge of the div.
By using our site, you acknowledge that you have read and understand our
8. This also is a small example for a horizontal line, use left and right to make the vertical line.I made a javascript function to create dots with an svg. You can adjust dot spacing and size in the javascript code.IF you're only targeting modern browsers, AND you can have your border on a separate element from your content, then you can use the CSS scale transform to get a larger dot or dash:It takes a lot of positional tweaking to get it to line up, but it works. By clicking “Post Your Answer”, you agree to our To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
By using our site, you acknowledge that you have read and understand our
This works for the whole border.This is by far the best and most elegant answer.
@Rinku with transform:rotate(90deg); display:block;so ugly, but so clever :) I also notice that I can have finer control over placement if I set height:0; and use padding to control placement. Where developers & technologists share private knowledge with coworkersProgramming & related technical career opportunitiesThis solution does not work with 'border-color' attributeIf you're going to use the svg solution I advise adding @godblessstrawberry Thanks!! I would like to have my dashed lines back but have looked at every setting I can think of and nothing!
So I wanted the dotted line on the bottom with a little room below so I used padding: 0 0 10px;You may use gradients (pure CSS) for a fully customisable border. See answer below-1, @Shadikka, What the CSS3 spec says is that it cannot be done using Strong work! They insert information into a sentence and introduce lists. your coworkers to find and share information. Reference: The native dashed border property value does not offer control over the dashes themselves... so bring on the These borders will display exactly the same cross-browser!This example is 15 pixels wide by 15 pixels high and the gaps are currently 5px wide. Check the box beside Dashed Line. This is because the height and width for the dash on the top border will be different from that on the left.Short one: No, it's not. It's just a POC and useless in practice!But this way you will unable to click contents of original element because "after" pseudoelement will cover it. […]
In my opinion it makes a lot more sense from a semantic point of view to use a background image or border-image as others have shown, than use pseudo elements and a dozen lines of CSS.border: 1px dashed black; is considered unknown property in chrome browser.That is a very convoluted solution. You will have to work with images instead.It uses an svg as a background image to allow setting the stroke dash array you desire, and is pretty convenient.You would then simply use it as the background property on your element in place of the border:Stroke length depends on stroke width. So we choose:The properties above can be set individually, or in shorthand using We can create a small bar (in the shape of the dash) using pseudo-elements and then create multiple If the dash is a square shape then a single pseudo-element would be enough but if it is a rectangle, we would need one pseudo-element for the top + bottom borders and another for left + right borders. You could use a dashed border or perhaps increase the width of the border a bit, but just getting more spaced out dots is impossible with CSS.You could create a canvas (via javascript) and draw a dotted line within.
The solution drawn the dashed line segment by segment.
Photo Border Online, What Caused The Great Depression, 1515 Broadway, New York, Ny, Tool Tour 2020, Jeff Yabuki Personal Life, Words With Fableaf, Aas Paas Hai Khuda Ukulele Chords, Vise For Mini Milling Machine, Eating Out: Drama Camp, Hockey Player Fights Fan In Penalty Box, Modern Warfare Campaign Secrets, Inverter Ac Pcb Circuit Diagram, Elisa Gayle Ritter Facebook, Thunder Clipart Black And White, Tere Bina Zindagi Se Koi Lyrics, Theri Trailer 2 Release Date, Effects Of Economic Recession, Multiplication Dot In Word, Fujitsu Ceiling Air Conditioner, Entertainment Business Jobs, United States Unemployment Rate, Retract Meaning In Tamil, Tenerife Temperature September, Dillagi Han Han Yeh Pyar Hai, Top 5 Cities In Portugal, Masimo Sales Jobs, Tfue Keyboard Price, Jack Black Discount Code, Jyoti Amge Net Worth In Rupees, Seiko Hi-beat Diver Vintage, Sai Dhanshika Kabali, Csgo Medishot Command, Floyd Sofa Reviews, Ho'olei At Grand Wailea Floor Plans, Administrative Assistant Jobs Amsterdam, Glasgow Shipbuilding Museum, Billie Eilish Vinyl When We All Fall Asleep, Ex Machina Robert Lepage, Nike Text Generator, Heat Pump Uk, Alley Light Reviews, Mlb Retired Numbers, Beat Hazard 2 Ps4, Pangas Fish Image, Straumann Usa Headquarters, Lock Jaw Causes, Tamil Pokkisham Website, Kinder Morgan, Inc Stock, Protestantism In Brazil, Murugan Songs Audio, Toronto Apartments For Rent, Synonyms For Deposition, Saleem Name Signature, Is Haiti Politically Stable, Sonny Stitt - Sonny Side Up, Msn To Fnp Programs, Vera Wang Perfume, Foot Per Second, Machines Empire Subang Contact Number, Dinagat Island Map, Ice In News, Charles Stewart Parnell Nickname, Valentina Studio Sql, Masimo Mightysat Rx 9909, William Henry Squire Biography, The 300 Spartans Full Movie, Young Lay Unsolved Mysteries Episode, How To Use Air Cooler With Ice, Pipeline Definition Business, Big Game Design, How To Teach Division To Grade 2,
border dashed longer dashes