How to make the application <body> max-width and centered?

Discussion forum about all things TD Mobile.
fatih
Turkey
Posts: 30
Joined: 12 Oct 2018, 06:39
Location: Turkey

How to make the application <body> max-width and centered?

Post by fatih » 17 Sep 2019, 20:17

Hello,

I want my application to run centered in web browser and I want to fix the width to 1024px if the actual width is greater than 1024px.

In order to do that, I add these lines to my styles.css file:

@media screen and (min-width: 1024px) {
body {
max-width: 1024px;
}
}

But this css is not applied. Is there anything wrong with my css definition?

Thank you,
Fatih

a_sivababu
India
Posts: 483
Joined: 10 Mar 2017, 08:46
Location: Chennai,India

Re: How to make the application <body> max-width and centered?

Post by a_sivababu » 18 Sep 2019, 08:35

Hi,
Please check this but not sure whether this will work as min-width is 1024 is something >= 1024 and this will fail.

@media screen and (min-width: 1025px) {
body {
max-width: 1024px;
}
}

I would suggest to use Jquery Syntax something like $(window).width() and $(<ID/element/class>).css() etc..

fyi - I am not sure about this requirement as all enterprise solutions apps will cover the end to end real estate of the system.

Thanks
Siva A

fatih
Turkey
Posts: 30
Joined: 12 Oct 2018, 06:39
Location: Turkey

Re: How to make the application <body> max-width and centered?

Post by fatih » 19 Sep 2019, 05:32

Thank you siva,

I'll evaluate this.

Fatih

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests