as Gennova Biopharmaceuticals launches a paediatric pack of pegaspargase, to treat rare blood cancer By www.thehindubusinessline.com Published On :: Fri, 08 Mar 2024 20:33:12 +0530 The drug, marketed as Hamsyl – Junior will now be available in a 1500 IU pack, and is priced at ₹Rs 20,970, a company official told businessline Full Article Science
as Universe is the limit for NASA-ISRO collaboration, says Swati Mohan By www.thehindubusinessline.com Published On :: Sat, 09 Mar 2024 10:03:32 +0530 Dr Swati Mohan, the Indian-born NASA engineer, whose historic words, “touchdown confirmed”, announced to the world the successful landing of the Perseverance rover on the surface of Mars on February 18, 2021 Full Article Science
as IIT-Madras’ brain research work finds a mention in Nvidia GTC By www.thehindubusinessline.com Published On :: Thu, 21 Mar 2024 12:30:56 +0530 IIT Madras’ Centre for Computational Brain Research is receiving support from Nvidia Full Article Science
as Starburst Accelerator SARL partners with IIT Madras to establish €100 million startup hub By www.thehindubusinessline.com Published On :: Tue, 26 Mar 2024 13:00:59 +0530 This collaboration aims to establish accelerator programs that enhance India’s Aviation, Space, and Defence ecosystem Full Article Science
as Why Russia is building the world’s biggest fast breeder reactor By www.thehindubusinessline.com Published On :: Mon, 01 Apr 2024 21:39:33 +0530 Many countries are watching Russia build a 1,200 MW fast breeder as a possible template for themselves Full Article Science
as TASL’s first ‘sub-metre optical’ satellite launched By www.thehindubusinessline.com Published On :: Mon, 08 Apr 2024 20:48:24 +0530 The SpaceX’s Falcon 9 rocket catapulted the TASL’s satellite from Launch Complex 39A at Kennedy Space Center on April 7, says TASL Full Article Science
as GUJCOST designated as Nodal Centre for ISRO’s START programme By www.thehindubusinessline.com Published On :: Tue, 09 Apr 2024 21:21:48 +0530 The ‘START’ programme is a kick start opportunity for the aspiring scientists and engineers Full Article Science and Technology
as US, Japan to announce plans to send Japanese astronaut to moon By www.thehindubusinessline.com Published On :: Thu, 11 Apr 2024 10:00:23 +0530 The astronaut from Japan will take part in the Artemis program, a NASA-led effort to return astronauts to the moon as early as 2026, more than half a century after the last Apollo mission. Full Article Science
as Global recognition to Gagandeep Kang for research on enteric diseases in children By www.thehindubusinessline.com Published On :: Thu, 11 Apr 2024 21:11:20 +0530 This was part of the Gairdner Foundation’s announcement of its 2024 Canada Gairdner Award winners Full Article Science
as Ananth Technologies founder Pavuluri Subba Rao gets Aryabhatta award for contribution to astronautics By www.thehindubusinessline.com Published On :: Thu, 18 Apr 2024 15:18:14 +0530 Ananth Technologies designs avionics for ISRO and Defence, supplying components to 98 satellites and 78 launch vehicles Full Article Science
as Veddas of Sri Lanka have close genetic link with India: Study By www.thehindubusinessline.com Published On :: Fri, 19 Apr 2024 21:18:16 +0530 The finding challenges the conventional isolation-by-distance model in genetic studies Full Article Science
as IIT Madras announces top 25 teams for Carbon Zero Challenge 4.0 By www.thehindubusinessline.com Published On :: Thu, 25 Apr 2024 15:11:52 +0530 These teams will be given six months of mentorship, training and support besides up to ₹5 Lakh to develop their prototypes for sustainable and circular economy solutions Full Article Science
as Krishna Ella is new president of Indian Vaccine Manufacturers Association By www.thehindubusinessline.com Published On :: Mon, 29 Apr 2024 12:07:57 +0530 “Vaccines are the vital pillar of global health, and the IVMA mission is to ensure that every individual, regardless of where they live, has access to life-saving immuniszations” - Krishna Ella, Co-Founder, Executive Chairman of Bharat Biotech Full Article Science
as AstraZeneca admits rare blood clot risk with Covishield, Vaxzevria vaccines By www.thehindubusinessline.com Published On :: Tue, 30 Apr 2024 09:06:50 +0530 The WHO has recognised TTS as a rare but serious adverse event linked to specific Covid-19 vaccines. Full Article Science
as BE’s 14-Valent Pneumococcal Conjugate Vaccine: Phase III trials prove ‘safety’ By www.thehindubusinessline.com Published On :: Tue, 30 Apr 2024 12:19:28 +0530 Pneubevax14 14 was found to be safe and induced robust and functional serotype specific immune responses to all 14 serotypes Full Article Science
as India flight tests missile-assisted torpedo release system By www.thehindubusinessline.com Published On :: Wed, 01 May 2024 15:13:10 +0530 The system was launched around 8.30 am from the ground mobile launcher. Full Article Science
as ICMR releases revised 'Dietary Guidelines for Indians', urges avoiding protein supplements By www.thehindubusinessline.com Published On :: Thu, 09 May 2024 16:04:15 +0530 Low intake of essential nutrients can disrupt metabolism and increase the risk of insulin resistance Full Article Science
as Solar storms that caused pretty auroras can create havoc with technology — here’s how By www.thehindubusinessline.com Published On :: Thu, 16 May 2024 14:39:46 +0530 These storms, caused by high energy particles from the Sun hitting our atmosphere, have the potential to knock out electrical grids and satellites Full Article Science
as IIT Madras partners with SilTerra Malaysia for silicon photonic processor chips By www.thehindubusinessline.com Published On :: Fri, 24 May 2024 12:46:13 +0530 These chips will be utilised for quantum computing and high-speed secured communication systems Full Article Info-tech
as NASA will soon train Indian astronauts for joint mission to International Space Station: US Envoy Eric Garcetti By www.thehindubusinessline.com Published On :: Sat, 25 May 2024 12:31:54 +0530 NASA to provide advanced training to Indian astronauts for joint mission to International Space Station, US envoy Eric Garcetti says Full Article Science
as “Take us to space and back”: Sunita Williams makes history with NASA’s Boeing Starliner By www.thehindubusinessline.com Published On :: Thu, 06 Jun 2024 09:26:27 +0530 The historic test flight, with fellow astronaut Barry Wilmore, aims to certify Starliner for routine space travel. Full Article Science
as What makes veteran astronauts Sunita Williams and Barry Wilmore ideal for Boeing’s Starliner test flight? By www.thehindubusinessline.com Published On :: Thu, 06 Jun 2024 09:42:33 +0530 Veteran NASA astronauts Sunita Williams and Barry Wilmore, with 500 combined days in space, piloted Boeing’s CST-100 Starliner from Florida, leveraging their extensive experience in spacewalks and ISS command. Full Article Science
as IIT Madras Alumnus Prem Watsa donates $5 million for brain research By www.thehindubusinessline.com Published On :: Tue, 18 Jun 2024 13:51:56 +0530 The Sudha Gopalakrishnan Brain Centre powers an ambitious Global Project to image the human brain at the cellular level by generating unprecedented human brain data, scientific output and technology tools Full Article Education
as Despite funding crunch, India’s deeptech start-ups has grown 2x since 2022 By www.thehindubusinessline.com Published On :: Thu, 20 Jun 2024 16:33:16 +0530 India ranks 6th amongst the top nine deeptech ecosystems globally Full Article Info-tech
as Boeing’s Starliner glitches prompt NASA to delay astronauts’ return from space station By www.thehindubusinessline.com Published On :: Sat, 29 Jun 2024 08:59:58 +0530 Problems with the capsule’s propulsion system and other related concerns have led to the delay in the astronauts’ return. Full Article Science
as Kulasekarapattinam spaceport: TN to promote Madurai, Thoothukudi, Tirunelveli, Virudhunagar as ‘Space Bay’ By www.thehindubusinessline.com Published On :: Mon, 01 Jul 2024 21:03:33 +0530 TIDCO plans to introduce additional incentives to attract companies and accelerate development in the region. Full Article Science
as Saturn’s moon Titan: Cassini radar reveals hydrocarbon sea details By www.thehindubusinessline.com Published On :: Tue, 16 Jul 2024 22:34:30 +0530 Recent analyses of Cassini’s radar data reveal detailed characteristics of Titan’s liquid hydrocarbon seas, primarily composed of methane and ethane. Full Article Science
as Indian astrophysicist Prahlad Chandra Agrawal honoured with COSPAR Harrie Massey Award 2024 By www.thehindubusinessline.com Published On :: Thu, 18 Jul 2024 16:32:34 +0530 Prahlad Chandra Agrawal is the first Indian recipient of this award, which recognizes outstanding contributions to the development of space research, particularly those in a leadership role. Full Article Science
as India to sign High Seas Treaty in September, joining global effort to protect ocean biodiversity By www.thehindubusinessline.com Published On :: Tue, 27 Aug 2024 16:07:46 +0530 India’s participation will enable it to contribute to global ocean governance, access biodiversity funds, and play a role in establishing marine protected areas and sharing marine genetic resources. Full Article Science
as Boeing’s Starliner lands empty as astronauts stay behind on ISS By www.thehindubusinessline.com Published On :: Sat, 07 Sep 2024 18:45:31 +0530 Despite the successful landing, two test pilots, Butch Wilmore and Sunita Williams, will remain in space until next year due to NASA’s safety concerns. Full Article Science
as Stuck-in-space astronauts reflect on being left behind and adjusting to life in orbit By www.thehindubusinessline.com Published On :: Sat, 14 Sep 2024 08:53:04 +0530 The astronauts stuck in space say it was hard to see their Boeing capsule leave without them Full Article Science
as Stuck NASA astronauts welcome SpaceX capsule that will bring them home next year By www.thehindubusinessline.com Published On :: Mon, 30 Sep 2024 08:47:35 +0530 SpaceX launched the rescue mission on Saturday with a downsized crew of two astronauts and two empty seats reserved for Butch Wilmore and Sunita Williams Full Article Science
as Europa Clipper: NASA’s billion-dollar mission to explore the potential for life on Jupiter’s Moon By www.thehindubusinessline.com Published On :: Tue, 15 Oct 2024 07:37:34 +0530 Embarking on a 1.8 million-mile journey from Kennedy Space Centre, the spacecraft is set to reach Jupiter in 5 1/2 years, utilising gravity assists from Mars and Earth Full Article Science
as With 11% increase over 2 decades, carbon dioxide accumulates faster in atmosphere By www.thehindubusinessline.com Published On :: Mon, 28 Oct 2024 16:45:15 +0530 WMO study says 2023 figure is 151 per cent % of pre-industrial period Full Article News
as Zinc futures retain the bullish bias By www.thehindubusinessline.com Published On :: Wed, 30 Oct 2024 12:13:03 +0530 Traders can consider long positions Full Article Commodity Calls
as Mastering Derivatives: Interpreting put-call ratio By www.thehindubusinessline.com Published On :: Fri, 01 Nov 2024 17:58:54 +0530 How to glean the relationship between put-call ratio and underlying returns Full Article Derivatives
as Index Outlook: Sensex, Nifty 50 consolidate as the fall pauses By www.thehindubusinessline.com Published On :: Sat, 02 Nov 2024 17:41:18 +0530 One more leg of downmove is still a possibility before the broader uptrend resumes Full Article Technical Analysis
as F&O Query: Should you hold call options on Infosys and Voltas? By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 14:41:25 +0530 Full Article Derivatives
as Bank Nifty Prediction today – Nov 7, 2024: Hovering around a support, short if this base is broken By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 10:34:16 +0530 Bank Nifty futures can fall to 51,300 if it slips below 52,000 Full Article Technical Analysis
as Natural gas futures: Uncertainty prevails By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 13:00:03 +0530 Traders need to wait for strong cues about next leg of trend Full Article Commodity Calls
as Mastering Derivatives: Does futures price decay? By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 21:30:17 +0530 Here’s a low down on the key components in future contracts’ pricing Full Article Derivatives
as Market correction broad-based with 7 of 10 stocks of BSE AllCap seeing a fall By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 22:02:55 +0530 FPI outflows overlapping with earnings slowdown and the return of the dragon weigh in Full Article Portfolio
as Coming soon, a new asset class to consider By www.thehindubusinessline.com Published On :: Mon, 11 Nov 2024 06:03:00 +0530 India’s securities regulator is looking to open up a fresh vehicle for investments for people in the mass affluent segment that will be different from existing mutual fund alternatives Full Article Personal Finance
as The right asset mix By www.thehindubusinessline.com Published On :: Mon, 11 Nov 2024 06:13:00 +0530 You should reduce equity investments and increase bond investments starting five years from the end of the time horizon for a goal. You should, however, save more during this period. Full Article Personal Finance
as aspect-ratio and grid By www.quirksmode.org Published On :: Tue, 11 May 2021 13:42:23 +0100 I’m currently investigating the new aspect-ratio declaration and plan to write an article about it. However, I got stuck on aspect ratios in a grid context. Chrome/Safari and Firefox do something different here, and I understand neither approach. So I hope I can get some help. aspect-ratio is currently supported by Chrome 90, by Firefox 88 with the correct flag enabled, and by Safari Technology Preview. I tested mostly in the first two — for complicated reasons I cannot install STP right now, but a kind Twitter follower sent me a few screenshots. It behaves as Chrome. First, a general remark. aspect-ratio is intentionally a fairly weak declaration. It gives way if other constraints on boxes make the requested aspect ratio impossible. Take this example: .my-box { width: 100px; height: 50px; aspect-ratio: 16/9; } The box has a fixed width and height, and they overrule the aspect-ratio. The box will thus have a 2/1 aspect ratio, as dictated by its width and height, and not a 16/9 one. Flexbox With that in mind, let’s first look at aspect-ratio in a flexbox environment. I think I understand what’s going on here, and the browsers all do the same, so this is a good reference point for the grid problems we’ll encounter later. Flex items take their width from the flexbox environment. In my example they have a flex-basis: 30%, but they could also have a width or even no width/flex-basis definition at all. In all cases the flexbox algorithm decides on the width of each item. Once the width has been determined, it’s time for the height. Let’s assume it’s not set. In flexbox, height: auto means not “as high as you need to be for your content” but “as high as the highest box in your row.” That is, naturally flexbox would give the boxes an equal width (because that’s what my flex declarations say) and an equal height (because that always happens in flexbox). Apparently, this counts as a set height for the aspect-ratio algorithm. As a result the 16/9 value is ignored because the 4/3 results in a larger height, and this value is therefore the one that determines the height of the entire row. As you see, the third box in this example does have the correct aspect ratio. That’s because it has an explicit height: min-content: set your height to whatever your content needs, and, more importantly, ignore the row height of the flex box. This, apparently, gives the aspect ratio algorithm the opening it needs to set the height to the one requested by the aspect-ratio: 16/9. I’m not sure if my reasoning is right. I am very certain that this works in all browsers, though, so you can use height: min-content in production straight away. (max-content also works. There’s no real difference between the two in height declarations.) flex aspect-ratio and min-content The problem: grid Now we get to the problem: grid. To follow along, please look at the example below in Firefox 88 with the aspect-ratio flag on, and in either Chrome or Safari Technology Preview. I expected grid to more or less behave the same as flexbox: the widths are set by the grid, the heights by the row height, and getting the proper aspect ratio would require height: min-content. That last clause is correct: the min-content trick works as it does in flexbox. It’s the behaviour of th 16/9 box without min-content that surprises me. Here, again, the third box has height: min-content and takes the correct aspect ratio, which means not obeying the row height, in all browsers. grid aspect-ratio and min-content Firefox first. All boxes get their correct aspect ratio and they all have the same width, as the repeat: (3,1fr) grid template dictates. That means their height differs. More importantly, the grid container box now becomes only as high as is necessary to contain the items as they would have been without their aspect ratio. I am 99% certain that the grid container behaviour is a bug. I am less certain whether the aspect-ratio being obeyed is also a bug. In Chrome, the second and third box behave as expected: the last box becomes less high than the row height because of height: min-content, and the second box dictates the row height with its 4/3 aspect ratio. But what’s up with the first box? It appears that it takes the row height as a given, but then sets the width to the value dictated by the 16/9 aspect ratio, ignoring the fact that this box now overflows its proper grid placement. Is this a bug? Or does height count for more than width in a grid context? I don’t know. In the second example all grid items have min-height: 100px. In all browsers they they calculate their width from their aspect ratio. Thus they break the grid-defined widths. This is understandable, given that the explicit height declaration is “stronger” than the implied widths from the grid definition. (Or rather: I devoutly hope I’m right here and not talking nonsense.) grid aspect-ratio and min-height: 100px; Thus maybe Firefox on the one hand and Chrome/Safari on the other are not as far apart as one would think from the first grid example. Still, something is buggy in that example. I just can’t figure out what it is. Stumped. Please help. Full Article CSS for JavaScripters as aspect-ratio By www.quirksmode.org Published On :: Wed, 19 May 2021 11:35:27 +0100 This week we’ll take a look at the new aspect-ratio declaration and its use. Una Kravets wrote the introductory article, but there are some additional technical points to be made. I also wrote a little fallback that you might use if you need aspect-ratio right now. At the time of writing aspect-ratio is supported by Chrome 90, by Safari Technology Preview, and by Firefox 88 if you set the aspect-ratio flag in about:config. You need one of these browsers to see the examples below — except for the fallback, which should work in all browsers that support custom properties. Weak declaration aspect-ratio defines the ratio between the width and height of a box, but it is a weak declaration. If the box has a specified width and height the browser uses those values and ignores the aspect ratio. Width and height might be specified by explicit width and height declarations or by other means, as we’ll see below. aspect-ratio In this example all three boxes have aspect-ratio: 16/9. The first box has width: auto; height: auto; i.e. as much width as you can take, and as little height as you need. aspect-ratio takes the width, converts it to pixels, and applies the defined aspect ratio to calculate the height. The second box has a height: 50px; width: auto. The height is strong, but the auto width is weak and allows aspect-ratio to override it. Thus the box’s width is calculated by taking the height and applying the aspect ratio. The third box has a fixed width: 150px; height: 100px as well as an aspect-ratio: 16/9. Now both width and height are strong and the aspect ratio is ignored. Rounding Even if aspect-ratio works fine the browser must find an integer number of device pixels for the box’s width and height. Fractions are discarded somewhere along the way. That’s why the calculated aspect ratio of a box is rarely 100% exact. In the examples you’ll often see a narrow stripe of red poking from underneath the background image. That image has the same aspect ratio as the box it appears in, but apparently uses a different calculation. In normal circumstances these tiny differences are not visible to the naked eye, so you can safely ignore them. Fat red stripes, such as in the last box in the first example, are a sign of trouble, though. min- and max-width and -height grid aspect-ratio and min- and max-height You can set a min/max-width/height on the boxes. These are obeyed as normal, and aspect-ratio is obeyed as well. In this example the first box has a min-height: 100px, the second a max-height: 50px, and the third min-width: 100px. As you see they stretch up or down to their defined maximum and minimum and retain their aspect-ratio. box-sizing: border-box! Now we come to a trickier topic unearthed originally by Ana Tudor — and this entire article is a good read that I recommend. If it works, aspect-ratio sets either the width or the height of a box to match the other side and the defined aspect ratio. However, the exact effect depends on how width and height are defined; on box-sizing, in other words. width may mean either the content width, without padding and border (box-sizing: content-box; the default), or the width of content + padding + border (box-sizing: border-box). In general, the latter is what we want. aspect-ratio and box-sizing In the next example the boxes have padding: 10%. Percentual padding is always calculated relative to the width of the parent element. Thus this box has a padding of 10% of its parent element’s width, even at the top and the bottom. Since the padding is equal on all four sides, it may break the box’s aspect ratio. This depends on box-sizing. If you use the default box-sizing: content-box the width and height have the correct aspect ratio, but they define only the content area. An equal amoung of padding is added on all sides, and the aspect ratio is destroyed. This problem is easy to solve: set box-sizing: border-box. Now width and height define the content, padding, and border combined, and this entire area is given the correct aspect ratio. Thus the padding is seamlessly integrated with the proper aspect ratio. In fact, you should always set box-sizing: border-box in all your sites. content-box was a mistake, as W3C itself admitted (and as I said back in 2002). The fact that it fixes aspect-ratio merely gives us an extra reason to do so. aapect-ratio in flexbox In a flex or grid context, aspect-ratio can appear not to work. In fact, running into these problems was what caused me to write this article in the first place. Look at the example below. It doesn’t work! Oh noesies! What’s going on? flex aspect-ratio What happens here is default flexbox behaviour. First the widths of the items are calculated (here from flex-basis: 30%; grow: 1), and once that’s done the height of all items is set. These heights are calculated by applying their aspect ratio, but the tallest box is used to set the height of all items in the row. In our example that is the 1/1 box, so the 16/9 and 4/3 boxes also have an aspect ratio of 1/1. This default behaviour is ruled by align-items: stretch, which is part of the flexbox default. If you use any other value the boxes’ height is set to auto and they take their proper aspect ratio. flex-start is the most obvious choice, but see CSS Tricks’ great flexbox guide for more options. flex aspect-ratio and align-items If for some reason you want to overrule the height stretch on only a single item you can give that item either align-self: flex-start or any other value, or height: min-content. Both work fine. The third box in the next example has height: min-content. flex aspect-ratio and height: min-content aspect-ratio and grid In a grid context aspect-ratio encounters the same problems as in a flexbox environment, only with added browser bugs that I wrote about last week. I expected the same behaviour as in a flexbox context, but that’s not entirely what’s happening. The good news is that align-items, align-self, and height: min-content all work exactly as with flexbox. They negate the default grid behaviour of stretching the height of all elements in a row to the height of the highest element. grid aspect-ratio and align-items The problems are in the default rendering of aspect-ratio. Chrome and Safari implement this in one incorrect way, and Firefox is a quite different, equally incorrect way. If all boxes in the example below have the same width and height the bugs have been solved. They get the same height for the reasons I explained under flexbox — grid works the same in this respect (I hope). grid aspect-ratio with browser bugs Firefox obeys the aspect-ratio while I think it shouldn’t. Instead, like in the flexbox example, it should stretch the boxes to the height of the highest in the row. In addition it calculates the height of the entire grid by assuming its items have the minimum height needed for their content — and since my example boxes do not have any content that height is 0. Thus the grid container is way too small. Both are clearly bugs that will probably be fixed soon. Chrome and Safari TP size the grid container correctly, but seem to take the height as reference and size the width accordingly instead of taking the width as reference and sizing the height. Thus the 16/9 and 4/3 items become way too wide. I think this is also a bug — if it isn’t someone will have to carefully explain to me what’s going on. Fortunately this bug goes away if you use align-items — which you’re going to want to do in any case. A fallback (After writing this fallback I found that Ana Tudor wrote pretty much the same one in her article. I mean, why do I even bother competing with scarily smart people like her? But I came by it independently, honest.) 5/1 3/1 16/9 4/3 9/16 Since browser support isn’t quite there yet we need to continue to use the old padding-top trick as a fallback, as I do in this paragraph. It is supposed to have an aspect ratio even in browsers that do not support aspect-ratio. The core of the fallback is the following CSS. Fair warning: this solution is only lightly tested; I went from conception to successful execution in about 30 minutes — though I spent 90 more minutes on a custom property issue. The extra <span> is ugly, but I don’t see a way around it. If your aspect-ratioed boxes do not contain text you can leave it out. <p class="test"><span>The text</span></p> p.test { --aspectRatio: 16/9; --padding: 0.5em; border: 1px solid; padding: var(--padding); aspect-ratio: var(--aspectRatio); box-sizing: border-box; } @supports not (aspect-ratio: 16/9) { p.test { padding: 0; padding-top: calc((1 / (var(--aspectRatio)))*100%); position: relative; } p.test > span { display: block; position: absolute; top: var(--padding); left: var(--padding); } } Store the desired aspect ratio in --aspectRatio. Set aspect-ratio to that value. If the browser doesn’t support aspect-ratio, set the padding-top to 1 / the aspect ratio as a percentage. The script that runs in this page changes the value of --aspectRatio. The trick here is that percentual padding is calculated relative to the parent element’s width. If the box spans its parent’s entire width, you can take that width, multiply it by 1 divided by the aspect ratio (so for instance 9/16th when the aspect ratio is 16/9) and convert the result to a percentage. Now the padding stretches the box to the desired aspect ratio. If the box has any real content we have to wrap it in an extra HTML element and give that element position: absolute so that it does not influence the box’s height. Then we place it in the box, with a top and left coordinate equal to the box’s padding. Now the text appears to flow naturally. You don’t need this trick if the box only has a background image or gradient; those ignore padding anyway. Or you can wait a few months until all browsers support aspect-ratio. It won’t be long now. I may write a separate article about the incredible number of brackets we need in the padding-top line. Full Article CSS for JavaScripters as Prakash Raj on creating ‘Nirdiganta’, an incubation centre for theatre, and getting back on stage By www.thehindu.com Published On :: Fri, 14 Jul 2023 11:55:55 +0530 Actor Prakash Raj says fans will soon get to see him perform live on stage Full Article Metroplus as Director Sai Rajesh: ‘Baby’ has been a learning experience; henceforth I will be more cautious in my writing By www.thehindu.com Published On :: Wed, 19 Jul 2023 16:16:44 +0530 Sai Rajesh, the writer-director of the Telugu romantic drama ‘Baby’ that has been eliciting extreme responses, says he did not intend to make a toxic film Full Article Movies as Rana Daggubati’s Spirit Media to launch ‘Hiranyakashyap’ movie, ‘Minnal Murali’ comic and more at San Diego Comic-Con 2023 By www.thehindu.com Published On :: Thu, 20 Jul 2023 12:39:02 +0530 Actor-producer Rana Daggubati’s Spirit Media debuts at San Diego Comic-Con 2023 by announcing the mythological film ‘Hiranyakashyap’ and comic based on the superhero film ‘Minnal Murali’ Full Article Movies as Scare at Kaddam project as it gets higher flood than discharge By www.thehindu.com Published On :: Thu, 27 Jul 2023 09:47:39 +0530 People in 12 villages downstream vacated, shifted to relief camps. Spillway discharge of flood waters begins at Jurala as Almatti, Narayanpur let out water Full Article Telangana «1..2..273709 710 711..815..1086..1357..1628..1899..2170..24412703» Recent Trending The Finish Line: Cast Stone and EIFS The Finish Line: A Case Study: What is Causing This? The Finish Line: Adhesives vs. Mechanical Fasteners Building Product Transparency— Be Careful What You Ask For Meeting Codes with Wall Assemblies Passive Houses Gain Momentum SIA Releases New Version of OSDP Standard Panasonic's Security Solutions Start With Energy-Efficient Products Securitas Technology Partners with K9s United in Support of Law Enforcement Canines Floyd & Associates unveils new website Latricrete Glass Tile Adhesive PICASSO, the art of flooring... Bellingham: A New Wool Collection from Karastan New Emser offering solid as a Rock FreeAxez gives access flooring an all-access pass Subscribe To Our Newsletter
as aspect-ratio By www.quirksmode.org Published On :: Wed, 19 May 2021 11:35:27 +0100 This week we’ll take a look at the new aspect-ratio declaration and its use. Una Kravets wrote the introductory article, but there are some additional technical points to be made. I also wrote a little fallback that you might use if you need aspect-ratio right now. At the time of writing aspect-ratio is supported by Chrome 90, by Safari Technology Preview, and by Firefox 88 if you set the aspect-ratio flag in about:config. You need one of these browsers to see the examples below — except for the fallback, which should work in all browsers that support custom properties. Weak declaration aspect-ratio defines the ratio between the width and height of a box, but it is a weak declaration. If the box has a specified width and height the browser uses those values and ignores the aspect ratio. Width and height might be specified by explicit width and height declarations or by other means, as we’ll see below. aspect-ratio In this example all three boxes have aspect-ratio: 16/9. The first box has width: auto; height: auto; i.e. as much width as you can take, and as little height as you need. aspect-ratio takes the width, converts it to pixels, and applies the defined aspect ratio to calculate the height. The second box has a height: 50px; width: auto. The height is strong, but the auto width is weak and allows aspect-ratio to override it. Thus the box’s width is calculated by taking the height and applying the aspect ratio. The third box has a fixed width: 150px; height: 100px as well as an aspect-ratio: 16/9. Now both width and height are strong and the aspect ratio is ignored. Rounding Even if aspect-ratio works fine the browser must find an integer number of device pixels for the box’s width and height. Fractions are discarded somewhere along the way. That’s why the calculated aspect ratio of a box is rarely 100% exact. In the examples you’ll often see a narrow stripe of red poking from underneath the background image. That image has the same aspect ratio as the box it appears in, but apparently uses a different calculation. In normal circumstances these tiny differences are not visible to the naked eye, so you can safely ignore them. Fat red stripes, such as in the last box in the first example, are a sign of trouble, though. min- and max-width and -height grid aspect-ratio and min- and max-height You can set a min/max-width/height on the boxes. These are obeyed as normal, and aspect-ratio is obeyed as well. In this example the first box has a min-height: 100px, the second a max-height: 50px, and the third min-width: 100px. As you see they stretch up or down to their defined maximum and minimum and retain their aspect-ratio. box-sizing: border-box! Now we come to a trickier topic unearthed originally by Ana Tudor — and this entire article is a good read that I recommend. If it works, aspect-ratio sets either the width or the height of a box to match the other side and the defined aspect ratio. However, the exact effect depends on how width and height are defined; on box-sizing, in other words. width may mean either the content width, without padding and border (box-sizing: content-box; the default), or the width of content + padding + border (box-sizing: border-box). In general, the latter is what we want. aspect-ratio and box-sizing In the next example the boxes have padding: 10%. Percentual padding is always calculated relative to the width of the parent element. Thus this box has a padding of 10% of its parent element’s width, even at the top and the bottom. Since the padding is equal on all four sides, it may break the box’s aspect ratio. This depends on box-sizing. If you use the default box-sizing: content-box the width and height have the correct aspect ratio, but they define only the content area. An equal amoung of padding is added on all sides, and the aspect ratio is destroyed. This problem is easy to solve: set box-sizing: border-box. Now width and height define the content, padding, and border combined, and this entire area is given the correct aspect ratio. Thus the padding is seamlessly integrated with the proper aspect ratio. In fact, you should always set box-sizing: border-box in all your sites. content-box was a mistake, as W3C itself admitted (and as I said back in 2002). The fact that it fixes aspect-ratio merely gives us an extra reason to do so. aapect-ratio in flexbox In a flex or grid context, aspect-ratio can appear not to work. In fact, running into these problems was what caused me to write this article in the first place. Look at the example below. It doesn’t work! Oh noesies! What’s going on? flex aspect-ratio What happens here is default flexbox behaviour. First the widths of the items are calculated (here from flex-basis: 30%; grow: 1), and once that’s done the height of all items is set. These heights are calculated by applying their aspect ratio, but the tallest box is used to set the height of all items in the row. In our example that is the 1/1 box, so the 16/9 and 4/3 boxes also have an aspect ratio of 1/1. This default behaviour is ruled by align-items: stretch, which is part of the flexbox default. If you use any other value the boxes’ height is set to auto and they take their proper aspect ratio. flex-start is the most obvious choice, but see CSS Tricks’ great flexbox guide for more options. flex aspect-ratio and align-items If for some reason you want to overrule the height stretch on only a single item you can give that item either align-self: flex-start or any other value, or height: min-content. Both work fine. The third box in the next example has height: min-content. flex aspect-ratio and height: min-content aspect-ratio and grid In a grid context aspect-ratio encounters the same problems as in a flexbox environment, only with added browser bugs that I wrote about last week. I expected the same behaviour as in a flexbox context, but that’s not entirely what’s happening. The good news is that align-items, align-self, and height: min-content all work exactly as with flexbox. They negate the default grid behaviour of stretching the height of all elements in a row to the height of the highest element. grid aspect-ratio and align-items The problems are in the default rendering of aspect-ratio. Chrome and Safari implement this in one incorrect way, and Firefox is a quite different, equally incorrect way. If all boxes in the example below have the same width and height the bugs have been solved. They get the same height for the reasons I explained under flexbox — grid works the same in this respect (I hope). grid aspect-ratio with browser bugs Firefox obeys the aspect-ratio while I think it shouldn’t. Instead, like in the flexbox example, it should stretch the boxes to the height of the highest in the row. In addition it calculates the height of the entire grid by assuming its items have the minimum height needed for their content — and since my example boxes do not have any content that height is 0. Thus the grid container is way too small. Both are clearly bugs that will probably be fixed soon. Chrome and Safari TP size the grid container correctly, but seem to take the height as reference and size the width accordingly instead of taking the width as reference and sizing the height. Thus the 16/9 and 4/3 items become way too wide. I think this is also a bug — if it isn’t someone will have to carefully explain to me what’s going on. Fortunately this bug goes away if you use align-items — which you’re going to want to do in any case. A fallback (After writing this fallback I found that Ana Tudor wrote pretty much the same one in her article. I mean, why do I even bother competing with scarily smart people like her? But I came by it independently, honest.) 5/1 3/1 16/9 4/3 9/16 Since browser support isn’t quite there yet we need to continue to use the old padding-top trick as a fallback, as I do in this paragraph. It is supposed to have an aspect ratio even in browsers that do not support aspect-ratio. The core of the fallback is the following CSS. Fair warning: this solution is only lightly tested; I went from conception to successful execution in about 30 minutes — though I spent 90 more minutes on a custom property issue. The extra <span> is ugly, but I don’t see a way around it. If your aspect-ratioed boxes do not contain text you can leave it out. <p class="test"><span>The text</span></p> p.test { --aspectRatio: 16/9; --padding: 0.5em; border: 1px solid; padding: var(--padding); aspect-ratio: var(--aspectRatio); box-sizing: border-box; } @supports not (aspect-ratio: 16/9) { p.test { padding: 0; padding-top: calc((1 / (var(--aspectRatio)))*100%); position: relative; } p.test > span { display: block; position: absolute; top: var(--padding); left: var(--padding); } } Store the desired aspect ratio in --aspectRatio. Set aspect-ratio to that value. If the browser doesn’t support aspect-ratio, set the padding-top to 1 / the aspect ratio as a percentage. The script that runs in this page changes the value of --aspectRatio. The trick here is that percentual padding is calculated relative to the parent element’s width. If the box spans its parent’s entire width, you can take that width, multiply it by 1 divided by the aspect ratio (so for instance 9/16th when the aspect ratio is 16/9) and convert the result to a percentage. Now the padding stretches the box to the desired aspect ratio. If the box has any real content we have to wrap it in an extra HTML element and give that element position: absolute so that it does not influence the box’s height. Then we place it in the box, with a top and left coordinate equal to the box’s padding. Now the text appears to flow naturally. You don’t need this trick if the box only has a background image or gradient; those ignore padding anyway. Or you can wait a few months until all browsers support aspect-ratio. It won’t be long now. I may write a separate article about the incredible number of brackets we need in the padding-top line. Full Article CSS for JavaScripters
as Prakash Raj on creating ‘Nirdiganta’, an incubation centre for theatre, and getting back on stage By www.thehindu.com Published On :: Fri, 14 Jul 2023 11:55:55 +0530 Actor Prakash Raj says fans will soon get to see him perform live on stage Full Article Metroplus
as Director Sai Rajesh: ‘Baby’ has been a learning experience; henceforth I will be more cautious in my writing By www.thehindu.com Published On :: Wed, 19 Jul 2023 16:16:44 +0530 Sai Rajesh, the writer-director of the Telugu romantic drama ‘Baby’ that has been eliciting extreme responses, says he did not intend to make a toxic film Full Article Movies
as Rana Daggubati’s Spirit Media to launch ‘Hiranyakashyap’ movie, ‘Minnal Murali’ comic and more at San Diego Comic-Con 2023 By www.thehindu.com Published On :: Thu, 20 Jul 2023 12:39:02 +0530 Actor-producer Rana Daggubati’s Spirit Media debuts at San Diego Comic-Con 2023 by announcing the mythological film ‘Hiranyakashyap’ and comic based on the superhero film ‘Minnal Murali’ Full Article Movies
as Scare at Kaddam project as it gets higher flood than discharge By www.thehindu.com Published On :: Thu, 27 Jul 2023 09:47:39 +0530 People in 12 villages downstream vacated, shifted to relief camps. Spillway discharge of flood waters begins at Jurala as Almatti, Narayanpur let out water Full Article Telangana