Ajust चित्रों में तालिका करने के लिए उन्हें में एक ही ऊंचाई पाठ के रूप में

0

सवाल

मैं संरेखित करने का प्रयास करें मेरी छवियाँ के अंदर एक td टैग करने के लिए है एक ही ऊंचाई/लेआउट के रूप में अपने पाठ? thank u

मेरे कोड इतनी दूर है:

<table style="border-bottom: 0px solid #ddd; margin-top: 20px;">
  <tr>
    <td id="instagram">
      <a href="https://www.instagram.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/instagram-social-media-camera-photo_icon-icons.com_59107.png" alt="Instagram" width="15%" /></a> Instagram</td>
    <td id="facebook">
      <a href="https://www.facebook.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/facebook-letter-social-media-f_icon-icons.com_59105.png" alt="Facebook" width="15%" /></a> Facebook</td>
    <td id="twitter">
      <a href="https://www.twitter.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/twitter-bird-animal-social-media_icon-icons.com_59106.png" alt="Twitter" width="15%" /></a> Twitter</td>
    <td id="youtube">
      <a href="https://www.youtube.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/youtube-video-social-media-play_icon-icons.com_59108.png" alt="Youtube" width="15%" /></a> Youtube</td>
  </tr>
  <tr>
    <td id="tinytext" colspan="4"> Follow for more </td>
  </tr>
</table>

css html image
2021-11-23 15:29:26
1

सबसे अच्छा जवाब

0

यदि आप चाहते हैं छवियों किया जा करने के लिए एक ही ऊंचाई के रूप में आप पाठ का उपयोग कर सकते हैं height: 1em. उन्हें है करने के लिए रिश्तेदार फ़ॉन्ट आकार का तत्व है. जो इस स्थिति में है 16px (फ़ॉन्ट आकार है 16px, छवि ऊंचाई 16px है).

यह हो सकता है अलग है, क्योंकि समस्या यह है कि आपकी छवियों के कुछ खाली/पारदर्शी उन्हें चारों ओर अंतरिक्ष - नहीं है तो यह देखो की तरह वे कर रहे हैं एक ही ऊंचाई. एक अन्य समस्या हो सकता है फ़ॉन्ट. फ़ॉन्ट्स अलग लाइन के ठिकानों और यह भी देखो की तरह यह नहीं है एक ही ऊंचाई. तो हो सकता है आप की जरूरत को समायोजित करने के लिए अपनी छवि ऊंचाई करने के लिए इसे और अधिक देखो एक जैसे एक ही ऊंचाई पर होने के बजाय इसे में एक ही ऊंचाई (उदाहरण के लिए height: 1.25emजोड़ने के लिए , कुछ margin या हो सकता है vertical-align में तालिका का उपयोग करें या flex आदि.)

img {
   height: 1em;
}
<table>
    <tr>
        <td id="instagram">
            <a href="https://www.instagram.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/instagram-social-media-camera-photo_icon-icons.com_59107.png" alt="Instagram"></a>
            Instagram
        </td>
        <td id="facebook">
            <a href="https://www.facebook.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/facebook-letter-social-media-f_icon-icons.com_59105.png" alt="Facebook"></a>
            Facebook
        </td>
        <td id="twitter">
            <a href="https://www.twitter.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/twitter-bird-animal-social-media_icon-icons.com_59106.png" alt="Twitter"></a>
            Twitter
        </td>
        <td id="youtube">
            <a href="https://www.youtube.com"><img src="https://cdn.icon-icons.com/icons2/640/PNG/512/youtube-video-social-media-play_icon-icons.com_59108.png" alt="Youtube"></a>
            Youtube
        </td>
    </tr>
</table>


उदाहरण के साथ पिक्सेल सही छवि:

img {
  height: 1em;
}
This is my text <img src="https://www.w3.org/2008/site/images/logo-w3c-mobile-lg" />


उदाहरण के लिए जो की तरह लगता है, एक ही ऊंचाई (इस्तेमाल किया फ्लेक्स केंद्र के लिए यह ऊर्ध्वाधर दिशा में):

div {
   display: flex;
   align-items: center;
}
img {
   height: 0.8em;
}
<div>
   UPPERCASE TEXT <img src="https://www.w3.org/2008/site/images/logo-w3c-mobile-lg" />
</div>

2021-11-23 15:58:05

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

इस श्रेणी में लोकप्रिय

लोकप्रिय सवाल इस श्रेणी में