S
S
SergeyKisliy2016-02-07 15:19:03
css
SergeyKisliy, 2016-02-07 15:19:03

Why does the caption tag behave like this?

Hello.
I make up a table, make it relative positioning, and after the caption tag I set absolute positioning, a white background, and with a negative top I drive it onto the table frame. In mozilla everything is fine, in chrome it's a problem. But it can be cured if corrected:

border {
border-collapse: collapse;
}

on the
border {
border-collapse: separate;
}

Why is that?
Mozilla:
b53924787d664816ae2fb34b24971ca6.png
Chrome:
f6efe8a18a6c47449d5f012e75611af6.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2016-02-07
@Afadeev

Is it important for you to set the frame with the title in this way? Tables are very specific and behave unpredictably with a non-standard approach.
For example, there is a special cross-browser tag
htmlbook.ru/html/legend

<fieldset>
  <legend>Стоимость аренды прицепа МЗСА</legend>
<table>
...
</table>
</fieldset>

css
fieldset {
  border: 5px solid #3A89C9;  
}
legend {
  padding:0 10px;
}

Another option is to wrap the table with a div with position - relative. Then the h3 tag for example with absolute positioning and then the table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question