ge Transformation of ZIF-8 nanoparticles into 3D nitrogen-doped hierarchically porous carbon for Li–S batteries By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17345-17352DOI: 10.1039/C9RA10063F, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Guiqiang Cao, Da Bi, Jingxiang Zhao, Jing Zheng, Zhikang Wang, Qingxue Lai, Yanyu LiangA novel transformation strategy assisted with ammonia treatment was successfully developed to fabricate ZIF-8-derived nitrogen-doped hierarchically porous carbon (NHPC/NH3).The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Ferroelectric P(VDF-TrFE)/POSS nanocomposite films: compatibility, piezoelectricity, energy harvesting performance, and mechanical and atomic oxygen erosion By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17377-17386DOI: 10.1039/D0RA01769H, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Y. Z. Liu, H. Zhang, J. X. Yu, Z. Y. Huang, C. Wang, Y. SunPoly(vinylidene difluoride) (PVDF) and its copolymers as the polymers with the highest piezoelectric coefficient have been widely used as sensors and generators.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Hydrogen bonding sewing interface By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17438-17443DOI: 10.1039/D0RA00366B, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Zhenxing Cao, Zhigong Song, Fengzhi Liang, Xiaoguang An, Karrar K. Al-Quraishi, Min Wang, Jianchao Chen, Dong Ding, Yingchao YangHydrogen bonding and van der Waals (vdW) forces have been precisely measured and distinguished by an in-house nanomechanical testing system.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge One pot fabrication of fluorescein functionalized manganese dioxide for fluorescence “Turn OFF–ON” sensing of hydrogen peroxide in water and cosmetic samples By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17506-17514DOI: 10.1039/D0RA01980A, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Hassan Refat H. Ali, Ahmed I. Hassan, Yasser F. Hassan, Mohamed M. El-WekilThe fluorometric nanoprobe was fabricated via doping of fluorescein dye in MnO2 nanosheets (FLS/MnO2 NS) via facile co-precipitation method. It was used for analysis of H2O2 in different matrices through liberation of FLS after reduction of MnO2 NS.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Synthesis and gas permeation properties of thermally rearranged poly(ether-benzoxazole)s with low rearrangement temperatures By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17461-17472DOI: 10.1039/D0RA00145G, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Yunhua Lu, Jianhua Zhang, Guoyong Xiao, Lin Li, Mengjie Hou, Junyi Hu, Tonghua WangA series of poly(ether-benzoxazole)(PEBO) for gas separation were prepared from 9,9-bis[4-(4-amino-3-hydroxylphenoxy)phenyl]fluorene based hydroxyl-containing poly(ether-imide)s (HPEIs) with low rearrangement temperatures.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge The influence of structural gradients in large pore organosilica materials on the capabilities for hosting cellular communities By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17327-17335DOI: 10.1039/D0RA00927J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Hannah Bronner, Anna-Katharina Holzer, Alexander Finke, Marius Kunkel, Andreas Marx, Marcel Leist, Sebastian PolarzChemical and structural gradients in biofunctionalized organosilica–polymer nanocomposites control cell adhesion properties and open perspectives for artificial cellular community systems.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Effect of temperature and large guest molecules on the C–H symmetric stretching vibrational frequencies of methane in structure H and I clathrate hydrates By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17473-17478DOI: 10.1039/D0RA02748K, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Go Fuseya, Satoshi Takeya, Akihiro HachikuboTemperature effect on C–H symmetric stretching frequencies of CH4 in water cages of sI and sH clathrate hydrates were clarified.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Boosting performances of triboelectric nanogenerators by optimizing dielectric properties and thickness of electrification layer By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17752-17759DOI: 10.1039/D0RA02181D, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Xiaofang Kang, Chongxiang Pan, Yanghui Chen, Xiong PuEnhanced output performances of a triboelectric nanogenerator (TENG) are achieved by optimizing the high-dielectric-constant filler content in the electrification layer and decreasing its thickness.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Correction: Influence of co-cultures of Streptococcus thermophilus and probiotic lactobacilli on quality and antioxidant capacity parameters of lactose-free fermented dairy beverages containing Syzygium cumini (L.) Skeels pulp By feeds.rsc.org Published On :: RSC Adv., 2020, 10,16905-16905DOI: 10.1039/D0RA90046J, Correction Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Sabrina Laís Alves Garcia, Gabriel Monteiro da Silva, Juliana Maria Svendsen Medeiros, Anna Paula Rocha de Queiroga, Blenda Brito de Queiroz, Daniely Rayane Bezerra de Farias, Joyceana Oliveira Correia, Eliane Rolim Florentino, Flávia Carolina Alonso BuritiThe content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge A chitosan-based edible film with clove essential oil and nisin for improving the quality and shelf life of pork patties in cold storage By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17777-17786DOI: 10.1039/D0RA02986F, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Karthikeyan Venkatachalam, Somwang LekjingThis study assessed chitosan (CS)-based edible films with clove essential oil (CO) and nisin (NI) singly or in combination, for improving quality and shelf life of pork patties stored in cold conditions.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Enhanced methane gas storage in the form of hydrates: role of the confined water molecules in silica powders By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17795-17804DOI: 10.1039/D0RA01754J, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Pinnelli S. R. Prasad, Burla Sai Kiran, Kandadai SowjanyaRapid and efficient methane hydrate conversions by utilising the water molecules confined in intra- and inter-granular space of silica powders.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Nitrogen-doped RuS2 nanoparticles containing in situ reduced Ru as an efficient electrocatalyst for hydrogen evolution By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17862-17868DOI: 10.1039/D0RA02530E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Yan Xu, Xiaoping Gao, Jingyan Zhang, Daqiang GaoThe reasonable design that N-doping and in situ reduced Ru metal enhances the performance of N-RuS2/Ru for HER.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge Selenium modulates cadmium-induced ultrastructural and metabolic changes in cucumber seedlings By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17892-17905DOI: 10.1039/D0RA02866E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Hongyan Sun, Xiaoyun Wang, Huimin Li, Jiahui Bi, Jia Yu, Xianjun Liu, Huanxin Zhou, Zhijiang RongIntensive insight into the potential mechanisms of Se-induced Cd tolerance in cucumber seedlings is essential for further improvement of vegetable crop cultivation and breeding to obtain high yields and quality in Cd-contaminated soil.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ge UCL update their homepage By nicolasgallagher.com Published On :: Wed, 07 Oct 2009 17:00:00 -0700 This week UCL have updated their homepage with a new design that I translated into XHTML, CSS, and Javascript. UCL will gradually be updating other parts of their website as they move forward. You can read the UCL blog post about their new homepage and the history of the UCL homepage. I was responsible for producing the XHTML, CSS, and Javascript that makes up the templates for this redesign. The members of UCL’s Web Services team then integrated the templates (and modified them as required) into their CMS. Full Article
ge Photogenic toad By nicolasgallagher.com Published On :: Mon, 24 May 2010 17:00:00 -0700 This toad jumped out of the long grass near a pond and kindly let me take a few photographs of it. Full Article
ge CSS image replacement. One more time. By nicolasgallagher.com Published On :: Sun, 13 Jun 2010 17:00:00 -0700 An accessible image replacement method using pseudo-elements and generated-content. This method works with images and/or CSS off, with semi-transparent images, doesn’t hide text from screen-readers or search engines, and provides fallback for IE 6 and IE 7. Known support: Firefox 1.5+, Safari 3+, Chrome 3+, Opera 9+, IE 8+ What’s wrong with current methods? The two most widely used image replacement techniques are the Gilder/Levin Method and the Phark Method. Both have different flaws. The Gilder/Levin Method requires the addition of presentational HTML (an empty span) and doesn’t work with transparent images as the default text shows through. The Phark Method uses a negative text-indent to hide the text and so it is not visible when CSS is on and images are off. Resurrecting the NIR method Using pseudo-elements and generated-content as an image replacement technique isn’t a new idea. It was proposed and demonstrated by Paul Nash back in 2006. This is the Nash Image Replacement method. <h1 class="nir">[content]</h1> .nir { height: 100px; /* height of replacement image */ padding: 0; margin: 0; overflow: hidden; } .nir:before { content: url(image.gif); display: block; } The height value is equal to that of the replacement image. Setting overflow:hidden ensures that the original content is not visible on screen when the image is loaded. The replacement image is inserted as generated content in the :before pseudo-element which is set to behave like a block element in order to push the element’s original content down. What about IE 6 and IE 7? Neither browser supports :before; if you need to support them you’ll have to rely on the Phark method. This can be done using conditional comments or safe IE6/7 hacks to serve alternative styles to legacy versions of IE . <!--[if lte IE 7]> <style> .nir { height: 100px; padding: 0; margin: 0; overflow: hidden; text-indent: -9000px; background: url(image.gif) no-repeat 0 0; } </style> <![endif]--> Using the NIR method allows you to keep your HTML semantic and deliver improved accessibility to users of modern browsers. The Phark Method can then be served to IE 6 and IE 7. Improving the NIR method The first problem with NIR is that if images are disabled all browsers leave whitespace above the element’s content. Opera 10.5 even displays the text string “image”! If the height of the element is small enough this whitespace causes the element’s content to overflow and be partially or completely hidden when images are disabled. Another consideration is what happens if an image doesn’t exist or fails to load. Safari and Chrome will display a “missing image” icon that cannot be removed. Once again, this can cause the element’s content to overflow and become partially or completely hidden to users. A more robust version of the NIR method is the following modification: .nir { height: 100px; /* height of replacement image */ width: 400px; /* width of replacement image */ padding: 0; margin: 0; overflow: hidden; } .nir:before { content: url(image.gif); display: inline-block; font-size: 0; line-height: 0; } Setting font-size and line-height to 0 avoids the whitespace problems in all browsers. Setting the element’s width equal to that of the replacement image and getting the pseudo-element to act as an inline-block helps minimise the problems in webkit browsers should an image fail to load. Ideally browsers would avoid displaying anything in a pseudo-element when its generated-content image fails to load. If that were the case, the original NIR method would be all that is needed. What about using sprites? One of the most common uses of image replacement is for navigation. This often involves using a large sprite with :hover and :active states as a background image. It turns out that using sprites is not a problem for modern browsers. When using the modified-NIR method the sprite is included as a generated-content image that is positioned using negative margins. This is an example that rebuilds the right-hand category navigation from Web Designer Wall using a sprite and the modified-NIR method. <ul id="nav"> <li id="nav-item-1"><a href="#non">Tutorials</a></li> <li id="nav-item-2"><a href="#non">Trends</a></li> <li id="nav-item-3"><a href="#non">General</a></li> </ul> /* modified-NIR */ #nav a { display: block; width: 225px; height: 46px; overflow: hidden; } #nav a:before { content:url(sprite.png); display:-moz-inline-box; /* for Firefox 1.5 & 2 */ display:inline-block; font-size:0; line-height:0; } /* repositioning the sprite */ #nav-item-1 a:hover:before, #nav-item-1 a:focus:before, #nav-item-1 a:active:before {margin:-46px 0 0;} #nav-item-2 a:before {margin:-92px 0 0;} #nav-item-2 a:hover:before, #nav-item-2 a:focus:before, #nav-item-2 a:active:before {margin:-138px 0 0;} #nav-item-3 a:before {margin:-184px 0 0;} #nav-item-3 a:hover:before, #nav-item-3 a:focus:before, #nav-item-3 a:active:before {margin:-230px 0 0;} /* :hover hack for IE8 if no a:hover styles declared */ #nav a:hover {cursor:pointer;} For some reason IE8 refuses to reposition the image when the mouse is over the link unless a style is declared for a:hover. In most cases you will have declared a:hover styles for the basic links on your webpage, and this is enough. But it is worth being aware of this IE8 behaviour. The addition of display:-moz-inline-box; is required to reposition the sprite in versions of Firefox prior to Firefox 3.0. They are very rare browsers but I’ve included it in case that level of legacy support is needed. If you want image replacement in IE 6 and IE 7 the following additional styles can be served to those browsers using conditional comments. /* Phark IR method */ #nav a { text-indent: -9000px; background: url(sprite.png) no-repeat; } /* repositioning the sprite */ #nav-item-1 a:hover, #nav-item-1 a:active { background-position: 0 -46px; } #nav-item-2 a { background-position: 0 -92px; } #nav-item-2 a:hover, #nav-item-2 a:hover { background-position: 0 -138px; } #nav-item-3 a { background-position: 0 -184px; } #nav-item-3 a:hover, #nav-item-3 a:active { background-position: 0 -230px; } /* hack for IE6 */ #nav a:hover { margin: 0; } The changes are fairly simple. But IE 6 applies the margins declared for a:hover:before to a:hover and so they need to be reset in the styles served to IE 6. See the modified-NIR (using sprites) demo. Full Article
ge CSS drop-shadows without images By nicolasgallagher.com Published On :: Fri, 10 Dec 2010 16:00:00 -0800 Drop-shadows are easy enough to create using pseudo-elements. It’s a nice and robust way to progressively enhance a design. This post is a summary of the technique and some of the possible appearances. Demo: CSS drop-shadows without images Known support: Firefox 3.5+, Chrome 5+, Safari 5+, Opera 10.6+, IE 9+ I’ll be looking mainly at a few details involved in making this effect more robust. Divya Manian covered the basic principle in her article Drop Shadows with CSS3 and Matt Hamm recently shared his Pure CSS3 box-shadow page curl effect. After a bit of back-and-forth on Twitter with Simurai, and proposing a couple of additions to Divya’s and Matt’s demos using jsbin, I felt like documenting and explaining the parts that make up this technique. The basic technique There is no need for extra markup, the effect can be applied to a single element. A couple of pseudo-elements are generated from an element and then pushed behind it. .drop-shadow { position: relative; width: 90%; } .drop-shadow:before, .drop-shadow:after { content: ""; position: absolute; z-index: -1; } The pseudo-elements need to be positioned and given explicit or implicit dimensions. .drop-shadow:before, .drop-shadow:after { content: ""; position: absolute; z-index: -1; bottom: 15px; left: 10px; width: 50%; height: 20%; } The next step is to add a CSS3 box-shadow and apply CSS3 transforms. Different types of drop-shadow can be produced by varying these values and the types of transforms applied. .drop-shadow:before, .drop-shadow:after { content: ""; position: absolute; z-index: -1; bottom: 15px; left: 10px; width: 50%; height: 20%; box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); transform: rotate(-3deg); } One of the pseudo-elements then needs to be positioned on the other side of the element and rotated in the opposite direction. This is easily done by overriding only the properties that need to differ. .drop-shadow:after{ right: 10px; left: auto; transform: rotate(3deg); } The final core code is as shown below. There is just one more addition – max-width – to prevent the drop-shadow from extending too far below very wide elements. .drop-shadow { position: relative; width: 90%; } .drop-shadow:before, .drop-shadow:after { content: ""; position: absolute; z-index: -1; bottom: 15px; left: 10px; width: 50%; height: 20%; max-width: 300px; box-shadow :0 15px 10px rgba(0, 0, 0, 0.7); transform: rotate(-3deg); } .drop-shadow:after{ right: 10px; left: auto; transform: rotate(3deg); } No Firefox 3.0 problems this time Some pseudo-element hacks require a work-around to avoid looking broken in Firefox 3.0 because that browser does not support the positioning of pseudo-elements. This usually involves implicitly setting their dimensions using offsets. However, as Divya Manian pointed out to me, in this case we’re only using box-shadow – which Firefox 3.0 doesn’t support – and Firefox 3.0 will ignore the position:absolute declaration for the pseudo-elements. This leaves them with the default display:inline style. As a result, there is no problem explicitly setting the pseudo-element width and height because it won’t be applied to the pseudo-elements in Firefox 3.0. Further enhancements From this base there are plenty of ways to tweak the effect by applying skew to the pseudo-elements and modifying the styles of the element itself. A great example of this was shared by Simurai. By adding a border-radius to the element you can give the appearance of page curl. .drop-shadow { border-radius: 0 0 120px 120px / 0 0 6px 6px; } I’ve put together a little demo page with a few of drop-shadow effects, including those that build on the work of Divya Manian and Matt Hamm. If you’ve got your own improvements, please send them to me on Twitter. Full Article
ge CSS background image hacks By nicolasgallagher.com Published On :: Sun, 16 Jan 2011 16:00:00 -0800 Emulating background image crop, background image opacity, background transforms, and improved background positioning. A few hacks relying on CSS pseudo-elements to emulate features unavailable or not yet widely supported by modern browsers. Demos: Example CSS background image hacks Pseudo-element hacks can fill some gaps in existing browser support for CSS features, without resorting to presentational HTML. In some cases, they even make it possible to emulate things that are not currently part of any W3C working draft, like background transforms and background image opacity. Most of the hacks in this article tie in with the pseudo-element hack described in an earlier article – Multiple Backgrounds and Borders with CSS 2.1. That article already describes how to emulate multiple background support and its demo page shows several other uses of the basic principle. This article presents a few of those effects and applications in greater detail. Emulating background-crop Known support: Firefox 3.5+, Opera 10+, Safari 4+, Chrome 4+, IE 8+ Demo: Pseudo background-crop Background image cropping can be emulated in modern browsers using only CSS 2.1. The principle behind a pseudo background-crop is to apply a background-image to a pseudo-element rather than the element itself. One example would be to crop an image to display in the background. Another would be to crop an image sprite to display icons alongside text in links. In several cases, using pseudo-elements may have advantages over existing, alternative techniques because it combines their strengths and avoids some of their weaknesses. Google, Facebook, and Twitter all make use of empty DOM elements to crop dense sprites and display icons next to certain links in their interfaces. The alternative is not to use empty elements but be forced into using multiple images and/or to design sub-optimal image sprites that have their component images spaced out. Pseudo-elements can be used in much the same way as empty DOM elements. This simultaneously eliminates the need for presentational HTML and doesn’t depend so heavily on an image sprite’s design. Using pseudo-elements for this purpose does have its own drawback – a lack of support in legacy browsers like IE6 and IE7. However, the technique will progressively enhance capable browsers while leaving a perfectly usable experience for incapable browsers. Example code: cropping a sprite This example shows how to crop icons that are part of a dense image sprite that uses a 16px × 16px grid. It uses a simple list and specifies a class for each type of action. <ul class="actions"> <li class="save"><a href="#">Save</a></li> <li class="delete"><a href="#">Delete</a></li> <li class="share"><a href="#">Share</a></li> <li class="comment"><a href="#">Comment</a></li> </ul> Styling can be applied to present this list in whatever way is needed. From that base, a pseudo-element can be created and then treated as you would an empty, inline DOM element (e.g. <span>). In this case, the :before pseudo-element is used and sized to match the sprite’s grid unit. It could be sized to whatever dimensions are required to match a section of the sprite that needs to be cropped. .actions a:before { content: ""; float: left; width: 16px; height: 16px; margin: 0 5px 0 0; background: url(sprite.png); } .save a:before { background-position: 0 -16px; } .delete a:before { background-position: 0 -32px; } .share a:before { background-position: 0 -48px; } .comment a:before { background-position: 0 -64px; } Providing hover, focus, active, and “saved” states is just a case of declaring the correct background position in each case. .save a:hover:before, .save a:focus:before, .save a:active:before { background-position: -16px -16px; } .saved a:before { background-position: -32px -16px; } Future alternatives In the future, there will be other alternatives. Firefox 3.6 added -moz-image-rect to allow background images to be cropped. But this is not supported by other browsers and looks likely to be replaced by an alternative proposal (to use fragment identifiers) that is part of the CSS Image Values Module Level 3 specification. As far as I know, no stable release of any modern browser supports the use of fragment identifiers with bitmap images at the time of writing. Emulating background-transform Known support: Firefox 3.6+, Opera 10.5+, Safari 4+, Chrome 4+, IE 9+ Demo: Pseudo background-transform Combining pseudo-elements and transforms makes it possible to emulate background transforms. A pseudo background-transform can be used to rotate, scale, and skew background images and sprites. There is no proposal for background-image transforms, so a pseudo-element hack is one way to emulate it. Example: rotating a background image The example of cropping sprites can be further developed by reducing the number of different images used in the sprite. Rather than applying transforms to images in a graphics package, they can be applied in the CSS. The code to do this is relatively simple and might look something like: .accordion a:before { content: ""; float: left; width: 16px; height: 16px; margin: 0 5px 0 0; background: url(sprite.png) no-repeat 0 0; } .accordion.open a:before { transform: rotate(90deg); } To apply a transform to a more conventional background image (e.g., a large graphic sitting behind some content that doesn’t affect the positioning of other components) requires use of the positioning technique detailed in the article Multiple Backgrounds and Borders with CSS 2.1. It involves setting the background image on a pseudo-element which is then positioned behind the content layer of an element using absolute positioning and z-index. Example: mirroring a background image There are instances when mirroring a background image might be desired. The approach is similar to that for rotating an image, but this time uses transform:scale(). Producing an exact mirror of an element or pseudo-element can be done using transform:scaleX(-1), transform:scaleY(-1), and transform:scale(-1,-1) to mirror along the x-axis, y-axis, and both axes, respectively. The following code is an example of how a pseudo background-transform might be used for pagination links. A pseudo-element displays a single image (or region of a sprite) and is then mirrored. The image’s appearance is such that a rotation cannot produce the desired counterpart. Only a scale operation can do it. .prev a:before, .next a:before { content: ""; float: left; width: 16px; height: 16px; margin: 0 5px 0 0; background: url(sprite.png) no-repeat 0 0; } .next a:before { float: right; margin: 0 0 0 5px; transform: scaleX(-1); } There is no support for this in IE 8. Even if you’re a fan of using IE filters to work around some missing CSS support, they won’t work on pseudo-elements. Future alternatives There don’t seem to be any future alternatives in any CSS working draft. For the moment, it looks like pseudo-element hacks will be needed to emulate effects like background transforms and background perspective without resorting to presentational HTML. Emulating background-position Known support: Firefox 3.5+, Opera 10+, Safari 4+, Chrome 4+, IE 8+ Demo: Pseudo background-position The CSS 2.1 specification limits the values of background-position to offsets from the left and top sides. It’s possible to emulate positioning a background image from the right and bottom sides by applying the background image to a pseudo-element and using it as an additional background layer. This hack is easily combined with the other hacks in this article. More details on the pseudo background-position hack can be found in the article on Multiple Backgrounds and Borders with CSS 2.1. Example code In this example, a pseudo-element is created and placed behind the element’s content layer. The background image is 500px × 300px and declared for the pseudo-element, which is also given dimensions that match those of the image. Since the pseudo-element is absolutely positioned, it can be positioned from the bottom and right of the element using offsets. #content { position: relative; z-index: 1; } #content:before { content: ""; position: absolute; z-index: -1; bottom: 10px; right: 10px; width: 500px; height: 300px; background: url(image.jpg); } Future alternatives There is a part of the CSS Backgrounds and Borders module working draft that describes an improvement to the background-position property to allow positions to be set from any side. At the moment, Opera 11 is the only stable release of a browser that has implemented it. Emulating background-opacity Known support: Firefox 3.5+, Opera 10+, Safari 4+, Chrome 4+, IE 9+ Demo: Pseudo background-opacity Changing the opacity of a pseudo-background is as simple as modifying the value of the opacity property. There is no IE 8 support for opacity and IE filters will not work on pseudo-elements. Example code This example code shows a pseudo-element being created and positioned behind the rest of the element’s content so as not to interfere with it. The pseudo-element is then sized to fit the element using offsets (but could be offset by other values or given an explicit size), given a background image, and has its opacity changed. #content { position: relative; z-index: 1; } #content:before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 0; right: 0; background: url(image.jpg); opacity: 0.7; } Notes For now, and as far as I am aware, using CSS 2.1 pseudo-elements is the only widely supported (and backwards compatible) way to emulate background image crop, background transform, background opacity, and improved background positioning with semantic HTML. Even when alternatives in CSS working drafts (e.g., the improved background-position and use of fragment identifiers) are widely implemented, pseudo-element background-image hacks will still have the advantage of letting you use other CSS properties like opacity, border-radius, border-image, box-shadow, transforms, etc., which may prove useful in certain situations. It can’t hurt to be aware of these options. It’s worth mentioning that although you can only generate 2 pseudo-elements from a DOM element, in many cases you can easily use descendant elements to provide more pseudo-elements to play with. This idea was used to help create the rotated example on the CSS drop-shadows demo page and several of the CSS3 examples at the bottom of the pure CSS speech bubbles demo page. Thanks to Mathias Bynens for reading and giving feedback on a draft of this article. Full Article
ge Responsive images using CSS3 By nicolasgallagher.com Published On :: Wed, 18 May 2011 17:00:00 -0700 Future CSS implementations should allow for some form of responsive images via CSS alone. This is an early idea for how that might be done. However, a significant drawback is that it would not prevent both “mobile optimised” and larger size images from being requested at larger screen resolutions. Note that the CSS presented here is not supported in any browsers at the time of writing. This method relies on the use of @media queries, CSS3 generated content, and the CSS3 extension to the attr() function. The principles are basically the same as those underpinning Filament Group’s work on Responsive Images. The source image is “mobile optimised” and the urls of larger size images are included using HTML data-* attributes. <img src="image.jpg" data-src-600px="image-600px.jpg" data-src-800px="image-800px.jpg" alt=""> Using CSS @media queries you can target devices above certain widths. Within each media query block, images with larger alternatives can be targeted using an attribute selector. CSS3 generated content allows you to replace the content of any element using the content property. At the moment, only Opera 10+ supports it. In CSS 2.1, the content property is limited to use with the :before and :after pseudo-elements. By combining the content property with the CSS3 extension to attr(), you will be able to specify that an attribute’s value is interpreted as the URL part of a url() expression. In this case, it means you will be able to replace an image’s content with the image found at the destination URL stored in a custom HTML data-* attribute. @media (min-device-width:600px) { img[data-src-600px] { content: attr(data-src-600px, url); } } @media (min-device-width:800px) { img[data-src-800px] { content: attr(data-src-800px, url); } } Fork the Gist Issues Unfortunately, there are a number of issues with this technique. It doesn’t prevent multiple assets being downloaded at larger screen widths because network activity kicks in before CSS is applied. That means, for example, that desktop environments would make 2 HTTP requests for an image and have to load more assets than if they had been served only the larger image in the source. It makes the assumption that wider screens are tied to better internet connections. It forces authors to create and maintain multiple image sizes for each image. At present, using the context menu (or drag and drop) to copy the image will result in the source file being copied and not the replacement image. It doesn’t account for devices with different pixel densities. Full Article
ge “Mobile first” CSS and getting Sass to help with legacy IE By nicolasgallagher.com Published On :: Mon, 28 Nov 2011 16:00:00 -0800 Taking a “mobile first” approach to web development poses some challenges if you need to provide a “desktop” experience for legacy versions of IE. Using a CSS pre-processor like Sass can help. As of Sass 3.2, there is another way of catering for IE, described by Jake Archibald. One aspect of a “mobile first” approach to development is that your styles are usually gradually built up from a simple base. Each new “layer” of CSS adds presentational adjustments and complexity, via CSS3 Media Queries, to react to and make use of additional viewport space. However, IE 6/7/8 do not support CSS3 Media Queries. If you want to serve IE 6/7/8 something more than just the base CSS, then you need a solution that exposes the “enhancing” CSS to those browsers. Popular existing options An existing option is the use of a CSS3 Media Query polyfill, such as Respond.js. However, there are some drawbacks to this approach (see the project README), such as the introduction of a JavaScript dependency and the XHRing of your style sheets, which may introduce performance or cross-domain security issues. Furthermore, adding support for CSS3 Media Queries is probably not necessary for these legacy browsers. The main concern is exposing the “enhancing” CSS. Another method, which Jeremy Keith has described in his post on Windows mobile media queries, is to use separate CSS files: one basic global file, and an “enhancing” file that is referenced twice in the <head> of the document. The “enhancing” file is referenced once using a media attribute containing a CSS3 Media Query value. This prevents it being downloaded by browsers (such as IE 6/7/8) which do not support CSS3 Media Queries. The same file is then referenced again, this time wrapped in an IE conditional comment (without the use of a CSS3 Media Query value) to hide it from modern browsers. However, this approach becomes somewhat cumbersome, and introduces multiple HTTP requests, if you have multiple breakpoints in your responsive design. Getting Sass to help Sass 3.1 provides some features that help make this second approach more flexible. The general advantages of the Sass-based approach I’ve used are: You have full control over how your style sheets are broken up and reassembled. It removes the performance concerns of having to reference several separate style sheets for each breakpoint in the responsive design, simply to cater for IE 6/7/8. You can easily repeat large chunks of CSS in separate compiled files without introducing maintenance problems. The basic idea is to produce two versions of your compiled CSS from the same core code. One version of your CSS includes CSS3 @media queries and is downloaded by modern browsers. The other version is only downloaded by IE 6/7/8 in a desktop environment and contains no CSS3 @media queries. To do this, you take advantage of the fact that Sass can import and compile separate .scss/.sass files into a single CSS file. This allows you to keep the CSS rules used at any breakpoint completely separate from the @media query that you might want it to be a part of. This is not a CSS3 Media Query polyfill, so one assumption is that IE 6/7/8 users will predominantly be using mid-size screens and should receive styles appropriate to that environment. Therefore, in the example below, I am making a subjective judgement by including all the breakpoint styles up to a width of 960px but withholding those for any breakpoints beyond that. The ie.scss file imports numerous other files, each containing a layer of CSS that builds upon the previous each layer of CSS. No CSS3 @media queries are contained within the files or the ie.scss file. It then compiles to a single CSS file that is designed to be served only to IE 6/7/8. // ie.scss @import "base"; @import "320-up"; @import "480-up"; @import "780-up"; @import "960-up"; The style.scss file imports the code for each breakpoint involved in the design (including any beyond the limit imposed for legacy versions of IE) but nests them within the relevant CSS3 @media query. The compiled version of this file is served to all browsers apart from IE 6/7/8 and IEMobile. // style.scss @import "base"; @media (min-width:320px) { @import "320-up"; } @media (min-width:480px) { @import "480-up"; } @media (min-width:780px) { @import "780-up"; } @media (min-width:960px) { @import "960-up"; } @media (min-width:1100px) { @import "1100-up"; } The resulting CSS files can then be referenced in the HTML. It is important to hide the ie.css file from any IE-based mobile browsers. This ensures that they do not download the CSS meant for desktop versions of IE. <!--[if (gt IE 8) | (IEMobile)]><!--> <link rel="stylesheet" href="/css/style.css"> <!--<![endif]--> <!--[if (lt IE 9) & (!IEMobile)]> <link rel="stylesheet" href="/css/ie.css"> <![endif]--> This Sass-enabled approach works just as well if you need to serve a basic style sheet for mobiles without CSS3 Media Query support, and prevent those devices from downloading the CSS used to adapt the layout to wider viewports. For example, you can avoid importing base.scss into the ie.scss and style.scss files. It can then be referenced separately in the HTML. <link rel="stylesheet" href="/css/base.css"> <link rel="stylesheet" href="/css/style.css" media="(min-width:320px)"> <!--[if (lt IE 9) & (!IEMobile)]> <link rel="stylesheet" href="/css/ie.css"> <![endif]--> You’ll notice that I didn’t wrap the style.css reference in a conditional comment to hide it from legacy versions of IE. It’s not necessary this time because the value of the media attribute is not understood by legacy versions of IE, and the style sheet will not be downloaded. In different circumstances, different combinations of style sheets and media attribute values will be more appropriate. Summary Even if you want to don’t want to use any of the Sass or SCSS syntax, the pre-processor itself can help you to write your CSS in a “mobile first” manner (with multiple breakpoints), provide a “desktop” experience for IE 6/7/8, and avoid some of the performance or maintenance concerns that are sometimes present when juggling the two requirements. I’m relatively new to using Sass, so there may be even better ways to achieve the same result or even to prevent the inclusion of IE-specific CSS unless the file is being compiled into a style sheet that only IE will download. Full Article
ge Another CSS image replacement technique By nicolasgallagher.com Published On :: Mon, 05 Mar 2012 16:00:00 -0800 A new image replacement technique was recently added to the HTML5 Boilerplate project. This post explains how it works and how it compares to alternative image replacement techniques. [15 December 2012] This technique is no longer used in HTML5 Boilerplate. It’s been replaced by another, more reliable approach. Here’s the CSS behind the recent update to the image replacement helper class in HTML5 Boilerplate. It has also made its way into the Compass framework. .ir { font: 0/0 a; text-shadow: none; color: transparent; } What does each declaration do? font:0/0 a – a shorthand property that zeros out the font size and line-height. The a value acts as a very short font-family (an idea taken from the BEM implementation of this method). The CSS validator complains that using 0/0 in the shorthand font property is not valid, but every browser accepts it and this appears to be an error in the validator. Using font:0px/0 a passes validation but it displayed as font:0/0 a in the code that the validator flags as valid. text-shadow:none – makes sure that any inherited text shadow is removed for the text. This prevents the chance of any text shadow colors showing over the background. color:transparent – needed for browsers than don’t completely crush the text to the point of being invisible. Safari 4 (extremely rare) is an example of such a browser. There may also be mobile browsers than require this declaration. IE6/7/8 don’t recognise this value for color, but fortunately IE7/8 don’t show any trace of the text. IE6 shows a faint trace. In the HTML5 Boilerplate image replacement helper, we’ve also removed any border and background-color that may be on the element. This makes it easier to use the helper class on elements like button or with links that may included background or border properties as part of a design decision. Benefits over text-indent methods The new technique avoids various problems with any text-indent method, including the one proposed by Scott Kellum to avoid iPad 1 performance problems related to large negative text indents. Works in IE6/7 on inline-block elements. Techniques based on text indentation are basically “broken”, as shown by this test case: http://jsfiddle.net/necolas/QZvYa/show/ Doesn’t result in any offscreen box being created. The text-indent methods result in a box being drawn (sometimes offscreen) for any text that have been negatively or positively indented. It can sometimes cause performance problems but the font-based method sidesteps those concerns. No need to specify a text-alignment and hide the overflow since the text is crushed to take up no space. No need to hide br or make all fallback HTML display:inline to get around the constraints of using a text indentation. This method is not affected by those problems. Fewer styles are needed as a result of these improvements. Drawbacks No image replacement hack is perfect. Leaves a very small trace of the text in IE6. This approach means that you cannot use em units for margins on elements that make use of this image replacement code. This is because the font size is set to 0. Windows-Eyes has a bug that prevents the reading of text hidden using this method. There are no problems with all other screenreaders that have been tested. Thanks to @jkiss for providing these detailed results and to @wilto for confirming this technique works for JAWS 12 in IE 6/7/8 and Firefox 4/5/6. Like so many IR methods, it doesn’t work when CSS is loaded but images are not. Text may not be hidden if a visitor is using a user style sheet which has explicitly set important font-size declarations for the element type on which you have applied the IR class. It’s worth noting that the NIR image replacement technique avoids these drawbacks, but lacks support in IE6/7. Closing comments I’ve been using this technique without significant problems for nearly a year, ever since Jonathan Neal and I used it in a clearfix experiment. The BEM framework also makes use of it for their icon components. The core idea was even proposed back in 2003 but the browser quirks of the day may have prevented wider use. If you come across any problems with this technique, please report them at the HTML5 Boilerplate GitHub issue tracker and include a test case when appropriate. Translations Nouvelle méthode de remplacement de texte par une image Full Article
ge Flexible CSS cover images By nicolasgallagher.com Published On :: Tue, 07 Jan 2014 16:00:00 -0800 I recently included the option to add a large cover image, like the one above, to my posts. The source image is cropped, and below specific maximum dimensions it’s displayed at a predetermined aspect ratio. This post describes the implementation. Demo: Flexible CSS cover images Known support: Chrome, Firefox, Safari, Opera, IE 9+ Features The way that the cover image scales, and changes aspect ratio, is illustrated in the following diagram. The cover image component must: render at a fixed aspect ratio, unless specific maximum dimensions are exceeded; support different aspect ratios; support max-height and max-width; support different background images; display the image to either fill, or be contained within the component; center the image. Aspect ratio The aspect ratio of an empty, block-level element can be controlled by setting a percentage value for its padding-bottom or padding-top. Given a declaration of padding-bottom:50% (and no explicit height), the rendered height of the element will be 50% of its width. .CoverImage { padding-bottom: 50%; } Changing that padding value will change the aspect ratio. For example, padding of 25% results in an aspect ratio of 4:1, padding of 33.333% results in an aspect ratio of 3:1, etc. Maximum dimensions The problem with using this aspect ratio hack is that if the element has a max-height declared, it will not be respected. To get around this, the hack can be applied to a pseudo-element instead. .CoverImage:before { content: ""; display: block; padding-bottom: 50%; } Now the main element can take a max-height. It should also clip the pseudo-element overflow. .CoverImage { display: block; max-height: 300px; max-width: 1000px; overflow: hidden; } .CoverImage:before { content: ""; display: block; padding-bottom: 50%; } This aspect ratio pattern is provided by the FlexEmbed component for SUITCSS. That component is primarily for responsive video embeds, but it’s flexible enough to be useful whenever you need an element rendered at a predetermined aspect ratio. It comes with modifiers for 2:1, 3:1, 16:9, and 4:3 aspect ratios. The cover image component can extend the FlexEmbed component. <div class="CoverImage FlexEmbed FlexEmbed--2by1"></div> Background image The cover image is applied as a background image that is sized to cover the entire area of the element. This makes sure the image is clipped to fit the aspect ratio of the element. .CoverImage { ... background-repeat: no-repeat; background-size: cover; } If you want different cover images for different instances of the component, they can be applied via the style attribute. <div class="..." style="background-image: url(cover.jpg)"></div> The image can be fully centered by using background positioning and block centering. This makes sure that the image is centered in the element, and that the element is centered within its parent (when it reaches the max-width value). .CoverImage { ... background-position: 50%; background-repeat: no-repeat; background-size: cover; margin: 0 auto; } Final result If you depend on the FlexEmbed module, the amount of additional code required is minimal. (See the demo for all the code, including the FlexEmbed dependency.) /** * Requires: suitcss/flex-embed */ .CoverImage { background-position: 50%; background-repeat: no-repeat; background-size: cover; margin: 0 auto; max-height: 300px; max-width: 1000px; } <div class="CoverImage FlexEmbed FlexEmbed--3by1" style="background-image:url(cover.jpg)"> </div> You can add further customizations, such as setting the accompanying background color, or providing a means to switch between the cover and contain keywords for background-size. Full Article
ge Migrant workers | Maharashtra train accident victims were battling hunger By www.thehindu.com Published On :: Sat, 09 May 2020 00:23:34 +0530 The previous night, they had called up relatives in Madhya Pradesh to say they were in a helpless state Full Article Other States
ge Take back changes in labour laws: Priyanka By www.thehindu.com Published On :: Fri, 08 May 2020 23:54:28 +0530 ‘U.P. government crushing their rights’ Full Article Other States
ge Muslim villagers help Hindu woman's last rites By www.assamtimes.org Published On :: Thu, 26 Mar 2020 11:38:47 +0000 Full Article
ge Rumour charge: AIUDF MLA arrested By www.assamtimes.org Published On :: Tue, 07 Apr 2020 03:14:06 +0000 Full Article
ge Guwahati likely to slip into orange zone By www.assamtimes.org Published On :: Fri, 08 May 2020 09:57:30 +0000 Full Article
ge Stop complainers and energy drainers [electronic resource] : how to negotiate work drama to get more done / Linda Byars Swindling By prospero.murdoch.edu.au Published On :: Swindling, Linda Byars, 1965- Full Article
ge Strategic excellence in the architecture, engineering, and construction industries [electronic resource] : how AEC firms can develop and execute strategy using lean Six Sigma / Gerhard Plenert and Joshua J. Plenert By prospero.murdoch.edu.au Published On :: Plenert, Gerhard Johannes, author Full Article
ge Strategic information management [electronic resource] : challenges and strategies in managing information systems / R.D. Galliers and D.E. Leidner By prospero.murdoch.edu.au Published On :: Galliers, Robert, 1947- Full Article
ge A strategic-oriented implementation of projects [electronic resource] / Mihály Görög, PhD, Professor of Project Management By prospero.murdoch.edu.au Published On :: Görög, Mihály, 1951- Full Article
ge Strategic risk management [electronic resource] : new tools for competitive advantage in an uncertain age / Paul C. Godfrey, [and three others] By prospero.murdoch.edu.au Published On :: Godfrey, Paul C., author Full Article
ge Strategic value management [electronic resource] : stock value creation and the management of the firm / Juan Pablo Stegmann By prospero.murdoch.edu.au Published On :: Stegmann, Juan Pablo Full Article
ge Strategische personalentwicklung in der praxis [electronic resource] : instrumente, erfolgsmodelle, checklisten, praxisbeispiele. / Christine Wegerich By prospero.murdoch.edu.au Published On :: Wegerich, Christine, author Full Article
ge Strategisches IT-Management [electronic resource] / Josephine Hofmann, Matthias Knoll (Hrsg.) By prospero.murdoch.edu.au Published On :: Full Article
ge Strategisches management für KMU [electronic resource] : unternehmenswachstum durch (r)evolutionäre Unternehmensführung / Gerrit Hamann By prospero.murdoch.edu.au Published On :: Hamann, Gerrit, author Full Article
ge Strategisches management und marketing [electronic resource] : markt- und wettbewerbsanalyse, strategische frühaufklärung, portfolio-management / Edgar Kreilkamp By prospero.murdoch.edu.au Published On :: Kreilkamp, Edgar Full Article
ge Streamlining business requirements [electronic resource] : the XCellR8 approach / Gerrie Caudle By prospero.murdoch.edu.au Published On :: Caudle, Gerrie Full Article
ge The stress test every business needs [electronic resource] : a capital agenda for confidently facing digital disruption, difficult investors, recessions and geopolitical threats / Jeffrey R. Greene, Steve Krouskos, Julie Hood, Harsha Basnayake, William Ca By prospero.murdoch.edu.au Published On :: Greene, Jeffrey R., author Full Article
ge Strukturierte Produkte in der Vermögensverwaltung. English By prospero.murdoch.edu.au Published On :: Full Article
ge Succeeding in the project management jungle [electronic resource] : how to manage the people side of projects / Doug Russell By prospero.murdoch.edu.au Published On :: Russell, Doug Full Article
ge Successes and failures of knowledge management [electronic resource] / edited by Jay Liebowitz, Distinguished Chair of Applied Business and Finance, Harrisburg University of Science and Technology, Harrisburg, Pennsylvania By prospero.murdoch.edu.au Published On :: Full Article
ge Successful management guidelines (collection) [electronic resource] / Martha I. Finney, Stephan Robbins By prospero.murdoch.edu.au Published On :: Finney, Martha I., author Full Article
ge Successful project management [electronic resource] : how to complete projects on time, on budget, and on target / Michael S. Dobson By prospero.murdoch.edu.au Published On :: Dobson, Michael Singer, author Full Article
ge Supply chain management [electronic resource] / Vinod V. Sople By prospero.murdoch.edu.au Published On :: Sople, Vinod V., author Full Article
ge Supply chain management at warp speed [electronic resource] : integrating the system from end to end / Eli Schragenheim, H. William Dettmer, J. Wayne Patterson By prospero.murdoch.edu.au Published On :: Schragenheim, Eli Full Article
ge Supply chain management for engineers [electronic resource] / Samuel H. Huang By prospero.murdoch.edu.au Published On :: Huang, Samuel H., author Full Article
ge Supply chain management process standards [electronic resource] : deliver processes / Council of Supply Chain Management Professionals By prospero.murdoch.edu.au Published On :: Council of Supply Chain Management Professionals, author Full Article
ge Supply chain management talent development [electronic resource] : acquire, develop, and advance processes / Council of Supply Chain Management Professionals By prospero.murdoch.edu.au Published On :: Council of Supply Chain Management Professionals, author Full Article
ge Sustainability in supply chain management (collection) [electronic resource] / Peter A. Soyka, Robert Palevich, Steven M. Leon By prospero.murdoch.edu.au Published On :: Soyka, Peter A., 1958- author Full Article