Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
76 views

I'm building a responsive MacBook screen component using CSS aspect-ratio, but I'm encountering a strange behavior where the aspect ratio gets distorted depending on how I position the inner content. ...
Valentin Mourtialon's user avatar
0 votes
0 answers
103 views

I'm rendering a PDF page to a canvas, where I compute the aspect-ratio of the canvas's container element from the physical aspect ratio of the PDF page, before rendering it to the screen. The HTML ...
JMA's user avatar
  • 479
0 votes
0 answers
52 views

I don't like when my HTML tooltips are disproportionally wide rectangles. On the other hand, a fixed max width makes tooltips with long text disproportionally tall rectangles. How to make HTML block (...
basin's user avatar
  • 4,214
1 vote
1 answer
152 views

I would like to add an image to my app, which is built using the react-native framework with expo. I want the Image component to: fill the width of its parent component fit the image's original ...
Jurakin's user avatar
  • 1,171
1 vote
1 answer
68 views

I need to find out how to keep a constant aspect ratio for a window on Tkinter. I tried below code, but it only works when dragging bottom or top edges, but not for edges to the right or left. On all ...
acp12395's user avatar
0 votes
0 answers
69 views

since elementor pro doesn't have the choice to set the aspect ratio of the pro gallery to 3/4, i want to add it with a css code i found. The gallery is the main page of my website. This is the code: ....
D M's user avatar
  • 1
0 votes
1 answer
88 views

I am just a beginner to HTML and javascript so I haven't fully grasped the language yet. I have hit a brick wall and am looking for some help. Click Here For The Situation The problem is that I am ...
lunarchild's user avatar
0 votes
1 answer
637 views

By default, Vidstack zooms/crops a vertical YouTube video into a 16/9 aspect ratio: If the height: 1000% styling is disabled, the vertical video is contained as desired. However, unwanted elements ...
Leftium's user avatar
  • 18k
1 vote
1 answer
103 views

I have a root SVG element, defined as this (inserted at the top of the <body>): <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3....
Shtole's user avatar
  • 367
0 votes
1 answer
226 views

I'm working on a layout where a child element inside a parent container must always maintain a 16:9 aspect ratio. The parent container's size can be dynamically adjusted through JavaScript, and the ...
Kodak3993's user avatar
0 votes
3 answers
536 views

Is there a way to align/position an <Image/> within its display area using Aspect="AspectFill" in .NET MAUI 8, or is there a workaround that produces the same visual result? I'm trying ...
user avatar
1 vote
1 answer
128 views

Actually i am reading this answer , but there is not enough information about aspect ratio . RectangleScreen : @Composable fun RectangleScreen(modifier: Modifier) { Canvas(modifier.border(7.dp , ...
Maham's user avatar
  • 114
1 vote
1 answer
150 views

I'm encountering an issue with a CSS Grid layout that works as expected in Chrome but exhibits a problem in Firefox. Specifically, the second column of the grid seems to ignore the first column in ...
Yura Beseda's user avatar
0 votes
0 answers
31 views

I have code that plots a map with user specified lat/long bounds. I use a defined map aspect ratio in order to keep the map at a constant size. If I don't my figtext moved well out of position. ...
scottthomaswx's user avatar
0 votes
0 answers
13 views

I have a div. I want to enforce its aspect ratio. As long as its set aspect ratio is preserved and my div is neither wider nor higher than the available vertical / horizontal space, I want it to ...
gaazkam's user avatar
  • 169
0 votes
3 answers
114 views

I am trying to combine object-fit: contains with aspect-ratio: 1.5 /* hardcoded number */ on an img. The image remains square, however: // Javascript for example resizing panels only. const ...
MHebes's user avatar
  • 3,415
0 votes
1 answer
488 views

I want to have Image occupying full width of its container and height will be based on aspect ratio provided explicitly. Also the image should cover all its frame and doesn't matter its content is cut ...
Pratik's user avatar
  • 4,900
1 vote
1 answer
90 views

I had a webpage which was working perfectly and resized the child canvas element (the checkerboard with a bunny), while keeping its 1:1 aspect ratio with a help of ResizeObserver, when the browser ...
Alexander Farber's user avatar
0 votes
3 answers
70 views

I’m using flex in a number input component to render custom “+” and “-” buttons next to the input itself. The buttons use aspect-ratio: 1/1; to ensure they are always square, but I can’t seem to get ...
Brandon Durham's user avatar
1 vote
0 answers
102 views

I am plotting some math functions in the domain x: [0, 0.01], y: [0, 1] using JS and SVG elements. My first approach was to scale the x-axis in order to have a "good" aspect ratio (for ...
hugopb82's user avatar
0 votes
2 answers
90 views

I'm trying to use grids to display my pictures and make them cover the whole page while not changing aspect ratio. But when I open my page on Firefox or Chrome there's a huge gap on the right side. ...
Shiny_Wil's user avatar
-1 votes
2 answers
343 views

I am using this code to get the aspect ratio final deviceAspectRatio = View.of(context).physicalSize.aspectRatio; It gives correct result in portrait but when I change the orientation in landscape ...
Shahbaz Hashmi's user avatar
0 votes
1 answer
127 views

Note: This question about a new feature in CSS: aspect-ratio. Most of the questions on this site with similar keywords are about very different techniques. Ok so there's a div with the following ...
tybro0103's user avatar
  • 49.9k
1 vote
1 answer
114 views

I have a parent container with a child div set to an aspect ratio of 2/1. When I resize the parent along the x-axis, the child scales accordingly. However, resizing along the y-axis doesn't affect the ...
MrBu's user avatar
  • 11
1 vote
5 answers
781 views

I am trying to build out a banner element on a website, and am having an issue getting it to fulfil the criteria I am after. Ideally I would like to have a solution that is CSS only. The layout is ...
Mike Harrison's user avatar

1
2 3 4 5
25