CSS calc width and height values

0 votes

How can I calculate the screen height using CSS and then use the result for the width calculation? Is it even conceivable?

myClass{    
    height: calc(60% - 34.5px);
    width: heightReturnedValue*1.3
}
Aug 3, 2022 in CSS by Edureka
• 13,620 points
7,021 views

1 answer to this question.

0 votes

Yes, there are CSS variables named vh (viewport height) and vw (viewport width) (viewport width). The screen is the viewport.

myClass {    
  height: calc(50% - 33.5px);
  width:  calc(100vh * 1.3);
}
answered Aug 4, 2022 by Tanishqa
• 1,170 points

Related Questions In CSS

0 votes
1 answer

Why vh works and % doesn't? (height css)

The height of an element, by default, ...READ MORE

answered Jun 10, 2022 in CSS by Edureka
• 12,690 points
1,790 views
0 votes
1 answer

Set cellpadding and cellspacing in CSS?

For controlling "cellpadding" in CSS, you can ...READ MORE

answered Jun 10, 2022 in CSS by Edureka
• 12,690 points
576 views
0 votes
1 answer

Setting top and left CSS attributes

You can alternatively use the setProperty method, ...READ MORE

answered Jun 10, 2022 in CSS by Edureka
• 12,690 points
374 views
0 votes
1 answer

How to create material design input form using css and bootstrap?

Try with this code. HTML: <div class="main_div"> ...READ MORE

answered Jun 21, 2022 in CSS by Edureka
• 12,690 points
2,487 views
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,597 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,882 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
959 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,689 views
0 votes
1 answer

Vertical and horizontal align (middle and center) with CSS?

There are many methods : Center horizontal and ...READ MORE

answered Aug 3, 2022 in CSS by Tanishqa
• 1,170 points
1,362 views
0 votes
1 answer

HTML and CSS: What do the <ul> and <li> tags stand for?

The term ul stands for unordered list. ...READ MORE

answered Aug 4, 2022 in CSS by Tanishqa
• 1,170 points
6,442 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