HTML combine border of two <a>
HTML combine border of two
I have a table with multiple elements within:
Fiddle: https://jsfiddle.net/p937jbee/1/
Is there a way to avoid double borders?
UPDATE: I can't change the HTML code and there are multiple Just add a seperate class to one or both of the boxes where you remove the border ex. JSFIDDLE html: Quick answer: You have to do 2 things, use the nth-of-type on a repeating element, in this case https://jsfiddle.net/6bgbmde5/ or you can use the background of the There are many ways that all have side-effects and it all depends on hovers and all sorts of stuff. Good luck! here is an updated fiddle, hopefully with be a solution for you Here is a solution for multiple cells: You need to zero out the left border for all cells except first one Have a look at snippet https://jsfiddle.net/54o0efuv/ Seefiddle Add CSS This should work even if you have multiple elements and not just 2. https://jsfiddle.net/p937jbee/4/ For a more consistant build-up I suggest to leave the right border, except for the last td. In case you'd like to add more blocks. CSS Since OP has stated that they can-not change the HTML a hacky CSS solution must be implemented. Therefor I will use negative margins which many of you frown upon but I don't care. Use the following CSS: use this css The border-collapse property is for use on elements (or elements made to behave like a table through display: table or display: inline-table). The most straightforward method is to assign instead of 2 of my example. Answer by Linushg111 for HTML combine border of two
a.one{ border-left: 0px; }
Answer by sheriffderek for HTML combine border of two
and change how you write your brackets. :P - but really, you may need to say, every 2nd or third block - depending on how you do things. You may want to just use a list instead of a table - depending on the goal. :nth-of-type(2n+2)
etc. Look her up. : ) HTML
CSS
.table a { background: #ff0000; width: 100px; height: 100px; display: block; border: 4px solid #000000; } .table td:nth-of-type(odd) a { border-right: 2px solid black; } .table td:nth-of-type(even) a { border-left: 2px solid black; }
tr
.table tr { display: block; background: black; padding: 4px; } .table a { background: red; width: 100px; height: 100px; display: block; } .table td:not(:last-of-type) a { margin-right: 4px; }
Answer by ashfaqrafi for HTML combine border of two
.TableClass td { background-color: #005500; height: 150px; } .TableClass a { background-color: #ff0000; width: 100px; height: 100px; display: block; } .elem1{ border-top: 5px solid #000000; border-bottom: 5px solid #000000; border-left: 5px solid #000000; } .elem2{ border-top: 5px solid #000000; border-bottom: 5px solid #000000; border-left: 5px solid #000000; border-right: 5px solid #000000; }
Answer by Banzay for HTML combine border of two
.TableClass tr td:not(:first-child) a { border-left: 0; }
Answer by Jagdish Parmar for HTML combine border of two
.TableClass td:nth-child(2) a { border-left:none; }
Answer by Mario Plantosar for HTML combine border of two
.TableClass td { background-color: #005500; height: 150px; } .TableClass a { background-color: #ff0000; width: 100px; height: 100px; display: block; border: 4px solid #000000; } .TableClass td:first-child a { border-right: 2px solid #000000; } .TableClass td:last-child a { border-left: 2px solid #000000; }
Answer by Falch0n for HTML combine border of two
.TableClass td { background-color: #005500; height: 150px; } .TableClass td a { background-color: #ff0000; width: 100px; height: 100px; display: block; border: 5px solid #000000; border-right: 0; } .TableClass td:last-of-type a { border-right: 5px solid #000000; }
Answer by Albert Renshaw for HTML combine border of two
.TableClass td { background-color: #005500; height: 150px; } .TableClass a { background-color: #ff0000; width: 100px; height: 100px; display: block; border: 5px solid #000000; margin-left:-5px; } .TableClass td:nth-child(1) a { margin-left:0px; }
Answer by Nitin Kanish for HTML combine border of two
border-collapse: collapse;
Answer by Mr Lister for HTML combine border of two
border-collapse:collapse
to the table and to move the border
property from the a
elements to the td
s. That is all you need to change.
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment