Why doesn t my div inside a span work properly

0 votes

I'm writing the following HTML markup:

<span> Some Text
    <div id="ch">татата</div>
</span>

and styles:

span{
    border: 1px solid black;
    text-align:center;
    width: 300px;
    height: 300px;
    background: aqua;
}
#ch{
    width:100px;
    height:100px
    background: yellow;   
}

Why is the width attribute applied to a div element inside a span but not the height property?
Why is my span missing its right border?

Jul 29, 2022 in HTML by Tejashwini
• 3,820 points
457 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In HTML

0 votes
0 answers

How do you create a hidden div that doesn't create a line break or horizontal space?

I want to have a hidden checkbox ...READ MORE

Jul 26, 2022 in HTML by Tejashwini
• 3,820 points
347 views
0 votes
1 answer

Why don't self-closing script elements work?

Hello @kartik, That's because SCRIPT TAG is not ...READ MORE

answered Apr 23, 2020 in HTML by Niroj
• 82,840 points
2,099 views
0 votes
1 answer

How to align a <div> to the middle (horizontally/width) of the page?

Hello Kartik, position: absolute and then top:50% and left:50% places the top edge ...READ MORE

answered Apr 23, 2020 in HTML by Niroj
• 82,840 points
789 views
0 votes
0 answers

Center a DIV horizontally and vertically

Can I  CENTER A DIV vertically and horizontally? ...READ MORE

May 23, 2022 in HTML by Kichu
• 19,040 points
392 views
0 votes
0 answers

Why does HTML5 recommend putting the code element inside pre?

The HTML5 documentation recommends putting the code ...READ MORE

Jul 4, 2022 in HTML by Tejashwini
• 3,820 points
317 views
0 votes
0 answers
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,540 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,250 points
2,846 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,350 points
924 views
0 votes
1 answer

What is the difference between span and div?

The div should be used to wrap sections of ...READ MORE

answered Jan 16, 2020 in Web Development by Niraj

edited Jan 21, 2020 by Niroj 3,639 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP