Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

foreignObject styling not working

  • Không có trả lời
  • 1 gặp vấn đề này
  • 20 lượt xem
more options

I don't know if this is the only style that doesn't work.

I used this code from MDN to test it :

https://codepen.io/Supersudo/pen/MWYYeba

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">

 <style>
   .test {
     color: white;
     font: 18px serif;
     height: 100px;
     overflow: auto;
   }
 </style>
 <polygon points="5,5 195,10 185,185 10,195" />
 <foreignObject x="20" y="20" width="160" height="160" style="border: 10px solid blue">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 </foreignObject>

</svg>

Firefox doesn't display the blue border around the div while chromium does.

I don't know if this is the only style that doesn't work. I used this code from MDN to test it : https://codepen.io/Supersudo/pen/MWYYeba <svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <style> .test { color: white; font: 18px serif; height: 100px; overflow: auto; } </style> <polygon points="5,5 195,10 185,185 10,195" /> <foreignObject x="20" y="20" width="160" height="160" style="border: 10px solid blue"> <div xmlns="http://www.w3.org/1999/xhtml" class="test"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> </foreignObject> </svg> Firefox doesn't display the blue border around the div while chromium does.

Được chỉnh sửa bởi Mark Lough vào