PHP : PHP ใส่ข้อความหรือข้อมูลในรูป ในตำแหน่งที่ต้องการ
ต้องใช้ CSS ช่วย
เช่น
Html
CSS
https://www.w3schools.com/howto/howto_css_image_text.asp
เช่น FlangeDimensions ของออกแบบ
Html
CSS
ต้องใช้ CSS ช่วย
เช่น
Html
- <div class="container">
- <img src="img_fjords_wide.jpg" alt="Norway" style="width:100%;">
- <div class="bottom-left">Bottom Left</div>
- <div class="top-left">Top Left</div>
- <div class="top-right">Top Right</div>
- <div class="bottom-right">Bottom Right</div>
- <div class="centered">Centered</div>
- </div>
CSS
- /* Container holding the image and the text */
- .container {
- position: relative;
- text-align: center;
- color: white;
- }
- /* Bottom left text */
- .bottom-left {
- position: absolute;
- bottom: 8px;
- left: 16px;
- }
- /* Top left text */
- .top-left {
- position: absolute;
- top: 8px;
- left: 16px;
- }
- /* Top right text */
- .top-right {
- position: absolute;
- top: 8px;
- right: 16px;
- }
- /* Bottom right text */
- .bottom-right {
- position: absolute;
- bottom: 8px;
- right: 16px;
- }
- /* Centered text */
- .centered {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
https://www.w3schools.com/howto/howto_css_image_text.asp
เช่น FlangeDimensions ของออกแบบ
Html
- <div class='container'>
- <img src='FLAT.jpg' alt='FLAT FACE' width='100%'>
- <div class='F_ODValue'>$OD</div>
- <div class='F_OCValue'>$OC</div>
- <div class='F_hValue'>$h</div>
- <div class='F_nValue'>$n</div>
- <div class='F_MValue'>$M</div>
- </div> ";
CSS
- /* Container holding the image and the text */
- .container {
- position: relative;
- text-align: center;
- color: white;
- }
- /* FLAT FACE */
- .F_ODValue {
- position: absolute;
- top: 19%;
- left: 37%;
- }
- .F_OCValue {
- position: absolute;
- top: 28%;
- left: 37%;
- }
- .F_hValue {
- position: absolute;
- top: 66%;
- left: 74%;
- }
- .F_nValue {
- position: absolute;
- top: 72%;
- left: 74%;
- }
- .F_MValue {
- position: absolute;
- top: 79%;
- left: 74%;
- }
- /* RAISED FACE */
- .R_ODValue {
- position: absolute;
- top: 11%;
- left: 37%;
- }
- .R_OCValue {
- position: absolute;
- top: 20%;
- left: 37%;
- }
- .R_OGValue {
- position: absolute;
- top: 28%;
- left: 37%;
- }
- .R_hValue {
- position: absolute;
- top: 66%;
- left: 74%;
- }
- .R_nValue {
- position: absolute;
- top: 72%;
- left: 74%;
- }
- .R_MValue {
- position: absolute;
- top: 79%;
- left: 74%;
- }
No comments:
Post a Comment