Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css outline always on first table row on chrome

on google chrome when you have outline on a table row you get it only on the first row

so using this css:

tr { 
      outline:1px solid red; 
   }

you'll get the outline only on the first row, you can see that if you open this link in chrome:

http://jsbin.com/enupey/27/edit

anybody knows any workaround/fix for this ?

Thank You

like image 429
Omu Avatar asked Aug 11 '12 18:08

Omu


People also ask

What is difference between outline and border?

Note: Outline differs from borders! Unlike border, the outline is drawn outside the element's border, and may overlap other content. Also, the outline is NOT a part of the element's dimensions; the element's total width and height is not affected by the width of the outline.

What is outline offset?

The outline-offset property adds space between the outline and the edge or border of an element. The space between an element and its outline is transparent. Outlines differ from borders in three ways: An outline is a line drawn around elements, outside the border edge. An outline does not take up space.

What is the outline focus?

Focus outline provides visual feedback for users who can't use a mouse, or have visual impairment, when using Tab on their keyboard for navigation. example.css. /* 🚫 don't do this */ :focus { outline: none; }

How do you outline text in CSS?

Sometimes we need to create text and adding the outline to the text. There are mainly two methods to create a border to the fonts which are listed below: Using text-shadow property. Using text-stroke property.


1 Answers

Though it appears to be a bug, a little googling and I found a working solution as part of this question

Adding:

display: block;

appears to work:

tr
{
  outline:1px solid red;
  display: block;
}

The edited result can be seen here


I fiddled around with the CSS a bit more and came up with this:

td
{
  border-top:1px solid red;
  border-bottom:1px solid red;
  bottom-padding:-1px;
}

table
{
  border-left:2px solid red;
  border-right:2px solid red;
  border-top:1px solid red;
  border-bottom:1px solid red;
  bottom-padding:-1px;
}

Would that be suitable?

Caveat: I did only test this on Google Chrome for Mac.

like image 183
James Webster Avatar answered Sep 17 '22 20:09

James Webster