el First-principles calculations of electronic structure and optical and elastic properties of the novel ABX3-type LaWN3 perovskite structure By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17317-17326DOI: 10.1039/C9RA10735E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Xing Liu, Jia Fu, Guangming ChenUsing first-principles calculation, the stable R3c LaWN3 as a new ABX3-type advanced perovskite structure is designed in the plan of the material genome initiative (MGI), which helps to widen the nowadays nitride perovskite material's application.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Deposition of an ultra-thin polyaniline coating on a TiO2 surface by vapor phase polymerization for electrochemical glucose sensing and photocatalytic degradation By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17387-17395DOI: 10.1039/D0RA01571G, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Sibani Majumdar, Debajyoti MahantaHere, we have synthesized an ultra-thin coating of polyaniline on a TiO2 nanoparticle surface (PANI–TiO2) using a simple vapor phase polymerization method.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el A dopamine electrochemical sensor based on a platinum–silver graphene nanocomposite modified electrode By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17336-17344DOI: 10.1039/C9RA11056A, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Nadzirah Sofia Anuar, Wan Jeffrey Basirun, Md. Shalauddin, Shamima AkhterA platinum–silver graphene nanocomposite was synthesized and characterized. A nanocomposite modified electrode was fabricated in order to investigate the electrochemical detection of dopamine.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el 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
el Development of novel N-(6-methanesulfonyl-benzothiazol-2-yl)-3-(4-substituted-piperazin-1-yl)-propionamides with cholinesterase inhibition, anti-β-amyloid aggregation, neuroprotection and cognition enhancing properties for the therapy of Alzheimer's d By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17602-17619DOI: 10.1039/D0RA00663G, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Chandra Bhushan Mishra, Shruti Shalini, Siddharth Gusain, Amresh Prakash, Jyoti Kumari, Shikha Kumari, Anita Kumari Yadav, Andrew M. Lynn, Manisha TiwariA novel series of benzothiazole–piperazine hybrids were rationally designed, synthesized, and evaluated as multifunctional ligands against Alzheimer's disease (AD).The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Polypyrrole modified magnetic reduced graphene oxide composites: synthesis, characterization and application for selective lead adsorption By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17524-17533DOI: 10.1039/D0RA01546F, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Zhanmeng Liu, Zhimin Gao, Lichun Xu, Fengping HuCompared to Fe3O4/rGO, the PPy-FG composites showed desirable adsorption capacity and selectivity for Pb(II) from water.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Elimination of humic acid in water: comparison of UV/PDS and UV/PMS By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17627-17634DOI: 10.1039/D0RA01787F, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Shoufeng Tang, Jiachen Tang, Deling Yuan, Zetao Wang, Yating Zhang, Yandi RaoIn this work, UV-activated persulphate treatment (UV/PDS and UV/PMS) was found to be an effective method for HA removal.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Selective modification of Ti6Al4V surfaces for biomedical applications By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17642-17652DOI: 10.1039/C9RA11000C, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Gabriela Melo Rodriguez, James Bowen, Mischa Zelzer, Artemis StamboulisThe surface of a medical implant is required to interact favourably with ions, biomolecules and cells in vivo, commonly resulting in the formation of the extracellular matrix.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Dual-site mixed layer-structured FAxCs3−xSb2I6Cl3 Pb-free metal halide perovskite solar cells By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17724-17730DOI: 10.1039/D0RA00787K, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Yong Kyu Choi, Jin Hyuck Heo, Ki-Ha Hong, Sang Hyuk ImDual site mixing of FAxCs3−xSb2I6Cl3 forms stable 2D layer structure.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Novel lightweight open-cell polypropylene foams for filtering hazardous materials By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17694-17701DOI: 10.1039/D0RA01499K, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Fei Wu, Pengke Huang, Haibin Luo, Jin Wang, Bin Shen, Qian Ren, Pei He, Hao Zheng, Liyang Zhang, Wenge ZhengLightweight polypropylene foams with similar geometries but different porous structures were prepared as filters for potentially hazardous materials via supercritical CO2 extrusion foaming without the use of harmful reagents and the problems of floating micro-nano fibers.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Correction: Role of polysilicon in poly-Si/SiOx passivating contacts for high-efficiency silicon solar cells By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17571-17571DOI: 10.1039/D0RA90049D, Correction Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.HyunJung Park, Soohyun Bae, Se Jin Park, Ji Yeon Hyun, Chang Hyun Lee, Dongjin Choi, Dongkyun Kang, Hyebin Han, Yoonmook Kang, Hae-Seok Lee, Donghwan KimThe content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el The synergistic influence of polyethyleneimine-grafted graphene oxide and iodide for the protection of steel in acidizing conditions By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17739-17751DOI: 10.1039/D0RA00864H, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.K. R. Ansari, Dheeraj Singh Chauhan, M. A. Quraishi, A. Y. Adesina, Tawfik A. SalehHerein, graphene oxide (GO) was chemically functionalized with polyethyleneimine (PEI) in a single step to obtain PEI-GO, which was characterized via FTIR spectroscopy, SEM, and TEM.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el 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
el Elongated conductive structures in detonation soot of high explosives By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17620-17626DOI: 10.1039/D0RA01393E, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Nataliya P. Satonkina, Alexander P. Ershov, Alexey O. Kashkarov, Ivan A. RubtsovMicrographs of transmission electron microscopy of saved detonation products of benzotrifuroxane at different scales.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el A novel series of phenolic temozolomide (TMZ) esters with 4 to 5-fold increased potency, compared to TMZ, against glioma cells irrespective of MGMT expression By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17561-17570DOI: 10.1039/D0RA02686G, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Leroy Shervington, Oliver Ingham, Amal ShervingtonThe standard of care treatment for patients diagnosed with glioblastoma multiforme (GBM) is temozolomide (TMZ).The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el A highly sensitive, selective and renewable carbon paste electrode based on a unique acyclic diamide ionophore for the potentiometric determination of lead ions in polluted water samples By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17552-17560DOI: 10.1039/D0RA01435D, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.M. A. Zayed, Walaa H. Mahmoud, Ashraf A. Abbas, Aya E. Ali, Gehad G. MohamedDue to the toxicity of lead(II) to all living organisms destroying the central nervous system and leading to circulatory system and brain disorders, the development of effective and selective lead(II) ionophores for its detection is very important.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Selective cytotoxic effect against the MDA-MB-468 breast cancer cell line of the antibacterial palindromic peptide derived from bovine lactoferricin By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17593-17601DOI: 10.1039/D0RA02688C, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Andrea Barragán-Cárdenas, Maribel Urrea-Pelayo, Víctor Alfonso Niño-Ramírez, Adriana Umaña-Pérez, Jean Paul Vernot, Claudia Marcela Parra-Giraldo, Ricardo Fierro-Medina, Zuly Rivera-Monroy, Javier García-CastañedaThe cytotoxic effect against the breast cancer cell line MDA-MB-468 of the palindromic peptide LfcinB (21–25)Pal: 1RWQWRWQWR9 and its analogous peptides, obtained via alanine scanning, was evaluated.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Electrochemical reduction of CO2 to ethylene on Cu/CuxO-GO composites in aqueous solution By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17572-17581DOI: 10.1039/D0RA02754E, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Nusrat Rashid, Mohsin Ahmad Bhat, U. K. Goutam, Pravin Popinand IngoleHerein, we present fabrication of graphene oxide supported Cu/CuxO nano-electrodeposits which efficiently and selectively can electroreduce CO2 into ethylene with a faradaic efficiency of 34% and conversion rate of 194 mmol g−1 h−1 at −0.985 V vs. RHE.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el 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
el 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
el Ni stabilized rock-salt structured CoO; Co1−xNixO: tuning of eg electrons to develop a novel OER catalyst By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17845-17853DOI: 10.1039/D0RA03050C, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Rakesh Mondal, Himanshu Ratnawat, Sarvesh Kumar, Anil Kumar, Preetam SinghIncorporation of Ni into CoO lattices helps to stabilize the rock salt structure and modulate the eg electrons to develop superior OER and ORR electrocatalysts.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Effect of Zn doping on phase transition and electronic structures of Heusler-type Pd2Cr-based alloys: from normal to all-d-metal Heusler By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17829-17835DOI: 10.1039/D0RA02951C, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Xiaotian Wang, Mengxin Wu, Tie Yang, Rabah KhenataBy first-principles calculations, for Heusler alloys Pd2CrZ (Z = Al, Ga, In, Tl, Si, Sn, P, As, Sb, Bi, Se, Te, Zn), the effect of Zn doping on their phase transition and electronic structure has been studied in this work.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el Correction: Narrowing band gap and enhanced visible-light absorption of metal-doped non-toxic CsSnCl3 metal halides for potential optoelectronic applications By feeds.rsc.org Published On :: RSC Adv., 2020, 10,17869-17869DOI: 10.1039/D0RA90054K, Correction Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Jakiul Islam, A. K. M. Akther HossainThe content of this RSS Feed (c) The Royal Society of Chemistry Full Article
el 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
el 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
el Thoughts on some new HTML5 elements By nicolasgallagher.com Published On :: Sun, 13 Sep 2009 17:00:00 -0700 In the last few months there has been increased discussion about some of the new elements that have been introduced in the HTML5 draft specification. This entry is primarily a counter argument to some of the comments that I disagree with. The most recent and high-profile comments in regard to parts of the HTML5 specification come from The HTML5 Super Friends in an article entitled Guide to HTML5 Hiccups. It lays out their concerns with the HTML5 draft specification as it stood at the time of its writing and I am largely going to focus on the issues they have discussed. The article and section elements The first argument that I disagree with is that the article and section elements are redundant and, therefore, that the article element should be dropped. article and section are identical except that article allows a pubdate attribute. We would suggest that article be dropped and section be adapted to allow an optional pubdate attribute or, even better, more explicit metadata. The article and section elements are not identical according the to HTML5 draft specification. Here is what it says about the section element as of 13 September 2009: The section element represents a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading, possibly with a footer. Now contrast that with what it says about the the article element: The article element represents a section of a page that consists of a composition that forms an independent part of a document, page, application, or site. An article element is “independent” in the sense that its contents could stand alone, for example in syndication, or as a interchangeable component on a user-configurable portal page. That is a clear distinction that resists the reading of article and section being “identical”. The article element has a specific purpose: to mark parts of a document that form an independent composition that may be appropriate for syndication. It is a special kind of sectioning element that performs an essential role that is lacking in the semantics of the generic section element. This generic element serves only to thematically group content. That grouping may occur at the document level, within an independent article, or within a footer. The article element has unique semantics and practical use. There is a fundamental conceptual difference between stand-alone compositions and sections of compositions, documents, or pages and this difference should be recognised and catered for in the specification. Websites regularly employ microformats and you don’t have to look far to see independent compositions currently marked up with class="hentry" or find links to individual blog comments and twitter updates. There is clearly a need for an easy way to define independent compositions and that is met with the introduction of the article element in HTML5. What may be needed is a stronger clarification and definition of the article element to minimise the potential for this distinction to be overlooked and to highlight the differences from a generic document section. The hgroup element The hgroup element is a relatively recent addition to the draft specification. It is defined as serving a fairly specific purpose: The hgroup element represents the heading of a section. The element is used to group a set of h1–h6 elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines. The element works to associate headings together so that the highest ranked heading descendant (if present) of the hgroup element is used as its text in document outlines and summary. Other heading descendants are treated as subheadings and are left out of outlines. The HTML5 Super Friends have this to say about the hgroup element: We don’t see the added value of this element and would instead add a boolean attribute to the heading element which allows content authors to specify if that particular heading should be included in the outline. Bruce Lawson has similar concerns and proposes another alternative – removing the need for a wrapping element and defining a new element specifically for marking up subtitles: I agree that hgroup is clumsy and likely to be misused. Rather than wrap an h1 and its h2 subtitle in hgroup to keep the subtitle out of the outlining algorithm, I would prefer to use <header> <h1>My blog</h1> <subtitle>My wit and wisdom</subtitle> </header> as I think that;s easier to understand than a heading-that’s-not-a-heading, and it removes a wrapping element. I disagree with these criticisms of the hgroup element and consider the proposed alternatives to be more problematic, less intuitive, less flexible, and further removed from the way in which authors currently markup subheadings. The way that many authors are currently marking up subheadings is by using headings of various ranks and in various orders depending on whether the subheading or qualifying heading needs to appear above or below the main page heading. A subheading is still, conceptually, a heading of sorts and it cannot be accurately marked up with a paragraph or any other currently available element. Allowing the addition of a boolean attribute to heading elements has several problems. A boolean attribute may be less intuitive for authors than the hgroup element. The hgroup element relies upon and produces an association between all the headings it contains. Since headings and subheadings occur together and derive their meaning from each other, it is semantic to wrap these headings in an element. We know that the highest ranked heading contains the string to be used in the outline and that the other headings serve as ranked subheadings to this primary heading. A boolean attribute is only associated with the element that it is a part of. We can create no association between the element and adjacent elements. This is related to the next issue. The hgroup itself acts as heading content while a boolean attribute would act only to remove headings from the outline. The hgroup element only removes the descendant headings that are those not of the highest rank. The boolean attribute shifts the burden onto the author to decide which headings should be marked for removal from the outline, rather than providing an element to wrap a collection of headings without authors having to be concerned with (or aware of) issues of outlining. What about Bruce Lawson’s idea for a subtitle element? I believe that, irrespective of the what this element were actually called, it suffers from similar problems to the idea of using a boolean attribute. There is nothing to prevent the use of a subtitle element away from a heading, it creates no association with other elements, and it does not allow for ranking of subheadings. One of my key points in relation to criticism of the hgroup element is that subheadings draw their meaning from context. A subheading (as opposed to a section heading) is only a sub-heading if it is associated with a higher ranking heading. Remove the higher ranking heading and what was once a subheading is likely to be understood as a heading. The strength of the hgroup element over the two alternative suggestions I have referenced is that it is the only proposal that defines a subheading as contextual. I think that it is the most intuitive proposal (although perhaps none of them are particularly inuitive) – the name of the element is self-descriptive and encapsulates the contextual relationship and adjacent positioning of its child elements — and matches most closely with the way that subheadings are currently marked up on many websites. The aside element The HTML5 Super Friends are of the opinion that the aside element is not worth including in the specification: The use cases for aside are too limited to warrant its inclusion in the specification. We were also concerned about potentially duplicating content within an aside. However, the specification itself provides some fairly compelling uses for the element: The element can be used for typographical effects like pull quotes or sidebars, for advertising, for groups of nav elements, and for other content that is considered separate from the main content of the page. Authors might use the aside element for their blogrolls, for marking up adverts ranging from google ads on blogs to large banners on enterprise websites, for expanding on themes within an article or providing an extended definition of a term, for pull quotes, and anything else “tangentially related to the content around the aside element, and which could be considered separate from that content”. Most of these uses would not involve duplication of content. Using the aside element for pull quotes would produce some instances of content duplication. However, this is not really a problem for users who are used to content being duplicated in this way in newspapers and magazines. It would not take much for search engines to adapt to deal with short amounts of duplicate content contained within an aside either. While I appreciate the point about duplicate content I’m not yet convinced that it is actually problematic. The legend element The current specification defines the legend element as providing an explanatory caption for the contents of its parent element. The parent element may be a fieldset, figure or details element. However, Remy Sharp‘s article entitled legend not such a legend anymore shows why it is not practical to use legend for the new elements details and figure – because it is not backwards compatible with current browsers and effectively unusable outside of a fieldset because of the inability to style the element. In this case, forging a new element is most appropriate rather than trying to use an element like label which will only create confusion with little advantage. Summary I have discussed my reasons for disagreeing with certain feedback on the HTML5 draft specification. I have yet to be convinced that the article, hgroup, or aside elements should be dropped from the specification because it seems to me that they have necessary uses and advantages over alternatives. Full Article
el New HTML5 elements: summary & figcaption By nicolasgallagher.com Published On :: Sun, 31 Jan 2010 16:00:00 -0800 Over the weekend two new HTML5 elements – summary and figcaption – were added to the draft specification. The introduction of summary and figcaption marks the acceptance that new elements are needed to act as captions or legends for the details and figure elements. The addition of the figcaption element finally begins to clear up the difficulty in marking-up figure element captions and looks to cement the place of the figure element in the HTML5 specification. The summary element does much the same for the details element but the very nature of the details element itself means that its future is not yet clear. The figcaption element This new element acts as the optional caption or legend for any content contained within its parent figure element. If there is no figcaption element within a figure element then there is no caption for the rest of its content. If there is a figcaption element then it must be the first or last child of the figure element and only the first figcaption element (should there be more than one child figcaption of the parent figure element) represents a caption. The figure element is used to mark up any self-contained content that may be referenced from the main flow of a document but could also be removed from the primary content (for example, to an appendix) without affecting its flow. This makes it suitable for various types of content ranging from graphs and data tables to photographs and code blocks. <p><a href="#fig-ftse">Figure 1</a> shows the extent of the collapse in the markets and how recovery has been slow.</p> <figure id="fig-ftse"> <figcaption>Figure 1. The value of the FTSE 100 Index from 1999–2009.</figcaption> <img src="ftse-100-index-graph.jpg" alt="The index hit a record high at the end of 1999 and experienced two significant drops in the following last decade."> </figure> <p>This latest financial crisis hasn't stopped Alex from writing music and his latest track is actually worth listening to.</p> <figure> <audio src="what-am-i-doing.mp3" controls></audio> <figcaption><cite>What am I doing?</cite> by Alex Brown</figcaption> </figure> The creation of the figcaption element is an important step forward for the HTML5 draft specification as it finally provides a reliable means to markup the caption for content that is best marked up as a figure. Previous attempts to use the legend element, the caption element, and the dt and dd elements had failed due to a lack of backwards compatibility when it came to styling these elements with CSS. The summary element This new element represents a summary, caption, or legend for any content contained within its parent details element. The summary element must be the first child of a details element and if there is no summary element present then the user agent should provide its own. The reason for this is because the details element has a specific function – to markup additional information and allow the user to toggle the visibility of the additional information. Although it is not specified in the specification, it is expected that the summary element will act as the control that toggles the open-closed status of the contents of the parent details element. <details> <summary>Technical details.</summary> <dl> <dt>Bit rate:</dt> <dd>190KB/s</dd> <dt>Filename:</dt> <dd>drum-and-bass-mix.mp3</dd> <dt>Duration:</dt> <dd>01:02:34</dd> <dt>File size:</dt> <dd>78.9MB</dd> </dl> </details> The introduction of the summary element seems to secure the future of the details element and the new behaviour that it affords, for now. When user agents begin to add support for the details element you won’t need JavaScript, or even CSS, to have expanding or collapsing sections in an HTML document. The future of the details element There will continue to be some debate over the inclusion of behaviour in an HTML specification especially given the widespread use of JavaScript to provide the expand-collapse functionality that details describes. The details element writes some quite significant behaviour into an HTML document and I can see it being abused to provide generic expand-collapse functionality throughout a document. It is also not entirely clear what purpose the details element actually serves other than being an attempt to bypass the need for JavaScript or CSS to expand or collapse sections of a document. There has been a general softening of the rough distinction between content, presentation, and behaviour. JavaScript libraries are being used to patch holes in browser CSS and HTML5 support, the CSS3 modules introduce plenty of behaviour that was previously only possibly with JavaScript, and the HTML5 specification is also introducing functionality and behaviour that previously required the use of JavaScript. The future survival of the details element, and the behaviour associated with it, may well depend on browser implementations and author applications over the coming months. Full Article
el Using HTML5 elements in WordPress post content By nicolasgallagher.com Published On :: Wed, 24 Feb 2010 16:00:00 -0800 Here are two ways to include HTML5 elements in your WordPress post content without WordPress’ wpautop function wrapping them in p tags or littering your code with line breaks. HTML5 has several new elements that you may want to use in your post content to markup document sections, headers, footers, pullquotes, figures, or groups of headings. One way to safely include these elements in your posts is simple; the other way is a bit more complicated. Both ways rely on hand-coding the HTML5 markup in the WordPress editor’s HTML view. If you are adding HTML5 elements to your post content then you should use an HTML5 doctype. Disable wpautop for your theme This is the simple way. Disable the wpautop function so that WordPress makes no attempt to correct your markup and leaves you to hand-code every line of your posts. If you want total control over every line of your HTML then this is the option for you. To disable wpautop entirely add these lines to your theme’s functions.php: remove_filter('the_excerpt', 'wpautop'); remove_filter('the_content', 'wpautop'); However, wpautop is generally quite useful if most of your posts are simple text content and you only occasionally want to include HTML5 elements. Therefore, modifying wpautop to recognise HTML5 elements might be more practical. Modify wpautop to recognise HTML5 elements WordPress’ wpautop is part of the core functions and can be found in this file within your WordPress installation: wp-includes/formatting.php. It controls how and where paragraphs and line breaks are inserted in excerpts and post content. In order to create a modified version of WordPress’ core wpautop function I started off by duplicating it in my theme’s functions.php file. What I’ve experimented with is disabling wpautop and adding a modified copy of it – which includes HTML5 elements in its arrayss – to my theme’s functions.php file. Add the following to your theme’s functions.php file and you’ll be able to use section, article, aside, header, footer, hgroup, figure, details, figcaption, and summary in your post content. (Probably best to try this in a testing environment first!) /* ----------------------------- MODIFIED WPAUTOP - Allow HTML5 block elements in wordpress posts ----------------------------- */ function html5autop($pee, $br = 1) { if ( trim($pee) === '' ) return ''; $pee = $pee . " "; // just to make things a little easier, pad the end $pee = preg_replace('|<br />s*<br />|', " ", $pee); // Space things out a little // *insertion* of section|article|aside|header|footer|hgroup|figure|details|figcaption|summary $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|header|footer|hgroup|figure|details|figcaption|summary)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', " $1", $pee); $pee = preg_replace('!(</' . $allblocks . '>)!', "$1 ", $pee); $pee = str_replace(array(" ", " "), " ", $pee); // cross-platform newlines if ( strpos($pee, '<object') !== false ) { $pee = preg_replace('|s*<param([^>]*)>s*|', "<param$1>", $pee); // no pee inside object/embed $pee = preg_replace('|s*</embed>s*|', '</embed>', $pee); } $pee = preg_replace("/ +/", " ", $pee); // take care of duplicates // make paragraphs, including one at the end $pees = preg_split('/ s* /', $pee, -1, PREG_SPLIT_NO_EMPTY); $pee = ''; foreach ( $pees as $tinkle ) $pee .= '<p>' . trim($tinkle, " ") . "</p> "; $pee = preg_replace('|<p>s*</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace // *insertion* of section|article|aside $pee = preg_replace('!<p>([^<]+)</(div|address|form|section|article|aside)>!', "<p>$1</p></$2>", $pee); $pee = preg_replace('!<p>s*(</?' . $allblocks . '[^>]*>)s*</p>!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); $pee = preg_replace('!<p>s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee); $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)s*</p>!', "$1", $pee); if ($br) { $pee = preg_replace_callback('/<(script|style).*?</\1>/s', create_function('$matches', 'return str_replace(" ", "<WPPreserveNewline />", $matches[0]);'), $pee); $pee = preg_replace('|(?<!<br />)s* |', "<br /> ", $pee); // optionally make line breaks $pee = str_replace('<WPPreserveNewline />', " ", $pee); } $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)s*<br />!', "$1", $pee); // *insertion* of img|figcaption|summary $pee = preg_replace('!<br />(s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol|img|figcaption|summary)[^>]*>)!', '$1', $pee); if (strpos($pee, '<pre') !== false) $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee ); $pee = preg_replace( "| </p>$|", '</p>', $pee ); return $pee; } // remove the original wpautop function remove_filter('the_excerpt', 'wpautop'); remove_filter('the_content', 'wpautop'); // add our new html5autop function add_filter('the_excerpt', 'html5autop'); add_filter('the_content', 'html5autop'); The results are not absolutely perfect but then neither is the original wpautop function. Certain ways of formatting the code will result in unwanted trailing </p> tags or a missing opening <p> tags. For example, to insert a figure with caption into a post you should avoid adding the figcaption on a new line because an image or link appearing before the figcaption will end up with a trailing </p>. <!-- this turns out ok --> <figure> <a href="#"><img src="image.jpg" alt="" /></a><figcaption>A figure caption for your reading pleasure</figcaption> </figure> <!-- this turns out not so ok --> <figure> <a href="#"><img src="image.jpg" alt="" /></a> <figcaption>A figure caption for your reading pleasure</figcaption> </figure> Another example would be when beginning the contents of an aside with a paragraph. You’ll have to leave a blank line between the opening aside tag and the first paragraph. <aside> This content could be a pullquote or information that is tangentially related to the surrounding content. But to get it wrapped in a paragraph you have to leave those blank lines either side of it before the tags. </aside> Room for improvement Obviously there are still a few issues with this because if you format your post content in certain ways then you can end up with invalid HTML, even if it doesn’t actually affect the rendering of the page. But it seems to be pretty close! Leave a comment or email me if you are using this function and find there that are instances where it breaks down. I ran numerous tests and formatting variations to try and iron out as many problems as possible but it’s unlikely that I tried or spotted everything. Hopefully someone with more PHP and WordPress experience will be able to improve upon what I’ve been experimenting with, or find a simpler and more elegant solution that retains the useful wpautop functionality while allowing for the use of HTML5 elements in posts. Please share anything you find! Full Article
el CSS pseudo-element Solar System By nicolasgallagher.com Published On :: Mon, 07 Jun 2010 17:00:00 -0700 This is a remix of another author’s idea of using CSS to make a classic model of our solar system. Here, I’ve relied on CSS pseudo-elements and generated content to render scale models of the solar system from simple markup of the raw information. There are three demos for this experiment, which is based on Alex Giron’s original Our Solar System in CSS3. Basic demo: Reworking of original experiment Advanced demo: Scale model of the Solar System Advanced demo (keyboard support): Scale model of the Solar System The basic demo uses only CSS and simple, semantic HTML to relatively faithfully reproduce Alex’s original result. The advanced demo is a rough scale model of the Solar System. It uses the same HTML as the “basic demo” but makes extensive use of CSS pseudo-elements, generated content, and various bits of CSS3. The advanced demo (keyboard support) is an attempt to provide keyboard support by introducing slight modifications to the HTML. I’ve commented out the animations in this version of the demo. Why rework the original experiment? I was curious to see if the same result could be achieved with simpler HTML, by relying on some newer CSS features. I experimented a bit further with generated content, shadows, and the way the layout of the solar system is implemented. Doing this exposed me to some of the different ways modern browsers are implementing CSS3. I’ve described some of those differences and bugs below. A scale model of the solar system The main demo is a scale model of the solar system. It uses 3 different scales: one for the object diameters; one for the distance of the planets from the sun; and one for the orbital period of each planet. Semantic HTML and Microdata The HTML is a list where each list item contains a title and description. I’ve included some HTML Microdata to provide hooks for generated content. <li id="earth" itemscope> <h2 itemprop="object">Earth <dl> <dt>Description</dt> <dd itemprop="description">Earth is an ocean planet. Our home world's abundance of water - and life - makes it unique in our solar system. Other planets, plus a few moons, have ice, atmospheres, seasons and even weather, but only on Earth does the whole complicated mix come together in a way that encourages life - and lots of it.</dd> <dt>Diameter</dt> <dd itemprop="diameter">12,755 <abbr title="kilometers">km</abbr></dd> <dt>Distance from sun</dt> <dd itemprop="distance">150×10<sup>6</sup> <abbr title="kilometers">km</abbr></dd> <dt>Orbital period</dt> <dd itemprop="orbit">365<abbr title="days">d</abbr></dd> </dl> </li> CSS pseudo-elements and generated content Pseudo-elements are used to produce the planets, Saturn’s ring, the planet names, and to add the scale information. Given that the scales only make sense when CSS is loaded it isn’t appropriate to have the scales described in the HTML. Both demos use the same HTML but only one of them is a rough scale model. Therefore, in the scale model demo I’ve used generated content to present the ratios and append extra information to the headings. header h1:after {content:": A scale model";} header h2:after {content:"Planet diameters 1px : 1,220 km / Distance from sun 1px : 7,125,000 km / Orbital period 1s : 4d";} #earth dd[itemprop=diameter]:after {content:" (5px) / ";} #earth dd[itemprop=distance]:after {content:" (22px) / ";} #earth dd[itemprop=orbit]:after {content:" (91s)";} Even more complex 3D presentations are likely to be possible using webkit-perspective and other 3D transforms. Keyboard support With a little modification it is possible to provide some form of keyboard support so that the additional information and highlighting can be viewed without using a mouse. Doing so requires adding block-level anchors (allowed in HTML5) and modifying some of the CSS selectors. Modern browser CSS3 inconsistencies This experiment only works adequately in modern browsers such as Safari 4+, Chrome 4+, Firefox 3.6+ and Opera 10.5+. Even among the current crop of modern browsers, there are bugs and varying levels of support for different CSS properties and values. In particular, webkit’s box-shadow implementation has issues. There are a few other unusual :hover bugs in Opera 10.5 (most obvious in the basic demo). It should also be noted that the :hover area remains square in all modern browsers even when you apply a border-radius to the element. Border radius There are also a few other peculiarities around percentage units for border radius. Of the modern browsers, a square object with a border-radius of 50% will only produce a circle in Safari 5, Chrome 5, and Firefox 3.6. Safari 4 doesn’t appear to support percentage units for border radius at all (which is why the CSS in the demos explicitly sets a -webkit-border-radius value for each object). Safari 5 and Chrome 5 do support percentage units for this property. However, Chrome 5 has difficulty rendering a 1px wide border on a large circle. Most of the border simply isn’t rendered. In Opera 10.5, if you set border-radius to 50% you don’t always get a circle, so I have had to redeclare the border-radius for each object in pixel units. Opera 10.5’s incorrect rendering of border-radius:50% It appears that this is one aspect of Opera’s non-prefixed border-radius implementation that is incorrect and in need of fixing. Box shadow Safari 4’s inferior box-shadow implementation means that inset shadows are not rendered on the planet bodies. In addition, the second box-shadow applied to Saturn (used to separate the planet from its ring) is completely missing in Safari 4 as it does not support a spread radius value. Safari 5 and Chrome 5 are better but still problematic. The second box-shadow is not perfectly round as the box-shadow seems to use the pseudo-element’s computed border-radius. Furthermore, Chrome 5 on Windows does not properly support inset box-shadow meaning that the shadow ignores the border-radius declaration and appears as a protruding square. Safari 5 and Chrome 5 make different mistakes in their rendering of this box-shadow The use of box-shadow to separate Saturn from the ring isn’t strictly necessary. You can create the separated ring using a border but box-shadow cannot be applied in a way that casts it over a border. Another alternative would be to add a black border around the planet to give the illusion of space between itself and the ring, but all browsers display a few pixels of unwanted background colour all along the outer edge of the rounded border. I wanted the ring to share the appearance of a shadow being cast on it. Opera 10.5 and Firefox 3.6 get it right. Both webkit browsers get it wrong. Full Article
el An introduction to CSS pseudo-element hacks By nicolasgallagher.com Published On :: Thu, 13 Oct 2011 17:00:00 -0700 CSS is a versatile style language that is most frequently used to control the look and formatting of an HTML document based on information in the document tree. But there are some common publishing effects – such as formatting the first line of a paragraph – that would not be possible if you were only able to style elements based on this information. Fortunately, CSS has pseudo-elements and pseudo-classes. As their names imply, they are not part of the DOM in the way that ‘real’ HTML elements and classes are. Instead, they are CSS abstractions that provide additional, and otherwise inaccessible, information about the document. This article will discuss the CSS pseudo-elements that are part of CSS 2.1 – :first-letter, :first-line, :before, and :after – and how the :before and :after pseudo-elements can be exploited to create some interesting effects, without compromising the simplicity of your HTML. But first, let’s look at each type of pseudo-element and how to use them in their basic form. The :first-line and :first-letter pseudo-elements The :first-line pseudo-element lets you apply styles to the first formatted line of a block container element (i.e., elements with their display property set to block, inline-block, list-item, table-caption, or table-cell). For example: p:first-line { font-weight: bold; } …will change the first line of every paragraph to bold. The :first-line pseudo-element can be treated as if it were an extra HTML inline element wrapping only the first line of text in the paragraph. The :first-letter pseudo-element lets you apply styles to the first letter (and any preceding punctuation) of the first formatted line of a block container element. No other inline content (e.g. an image) can appear before the text. For example: p:first-letter { float: left; font-size: 200%; } …will produce a basic ‘drop cap’ effect. The first letter of every paragraph will be floated left, and twice as large as the other letters in the paragraph. The :first-letter pseudo-element can be treated as if it were an extra HTML inline element wrapping only the first letter of text in the paragraph. The :first-line and :first-letter pseudo-elements can only be attached to block container elements, but the first formatted line can be contained within any block-level descendant (e.g., elements with their display property set to block or list-item) in the same flow (i.e., not floated or positioned). For example, the following HTML fragment and CSS: <div><p>An example of the first line of text being within a descendant element</p></div> div:first-line { font-weight: bold; } …would still result in a bold first line of text, because the paragraph’s text is the first formatted line of the div. The :before and :after pseudo-elements The :before and :after pseudo-elements are used to insert generated content before or after an element’s content. They can be treated as if they were extra HTML inline elements inserted just before and after the content of their associated element. Generated content is specified using the content property which, in CSS 2.1, can only be used in conjunction with the :before and :after pseudo-elements. Furthermore, you must declare the content property in order to generate the :before and :after pseudo-elements. The content property can take string, url(), attr(), counter() and counters() values. The url() value is used to insert an image. The attr() function returns as a string the value of the specified attribute for the associated element. The counter() and counters() functions can be used to display the value of any CSS counters. For example, the following HTML fragment and CSS: <a href="http://wikipedia.org">Wikipedia</a> a:after { content: " (" attr(href) ")"; } …would display the value of the href attribute after a link’s content, resulting in the following anchor text for the example above: Wikipedia (http://wikipedia.org). This can be a helpful way to display the destination of specific links in printed web documents. Keep in mind that CSS is meant for adding presentation and not content. Therefore, the content property should be used with caution. It’s also worth noting that the :first-letter and :first-line pseudo-elements apply to the first letter and first line of an element including any generated content inserted using the :before and :after pseudo-elements. Browser support for pseudo-elements The :first-letter and :first-line pseudo-elements were introduced in CSS1 and there is wide basic support for them. However, IE 6 and IE 7 have particularly buggy implementations; even modern browsers are not entirely consistent in the way that they handle the :first-line and :first-letter pseudo-elements (example bugs). The :before and :after pseudo-elements were introduced in the CSS 2.1 specification and are fully implemented in Firefox 3.5+, IE 8+, Safari 3+, Google Chrome, and Opera. Modern versions of Firefox even support CSS transitions and animations applied to pseudo-elements. However, legacy browsers like IE 6 and IE 7 do not support the :before and :after pseudo-elements at all. For more detailed information on pseudo-element browser support, browser bugs, and workarounds, have a look at Sitepoint’s reference and this article on IE 6/7 issues. In most cases, the :before and :after pseudo-elements can be used as part of a ‘progressive enhancement’ approach to design and development, because IE 6 and IE 7 will simply ignore them altogether. Alternatively, Modernizr now includes a robust feature test for generated content, providing one way to specify fallbacks or enhancements depending on browser support. The important thing is to remember to check what happens in browsers where support is missing. Alternative ways to use pseudo-elements Let’s take a look at how the :before and :after pseudo-elements can be used as the basis for some interesting effects. Most of the time, this involves generating empty :before and :after pseudo-elements by declaring an empty string as the value of the content property. They can then be manipulated as if they were empty inline HTML elements, keeping your HTML clean and giving you full control of certain effects from within CSS style sheets. Simple visual enhancements, like speech bubbles and folded corners, can even be created without the need for images. This relies on the fact that you can create simple shapes using CSS. Several types of ‘CSS polygons’ can be created as a result of browsers rendering borders at an angle when they meet. This can be exploited to create triangles. For example, the following HTML fragment and CSS: <div class="triangle"></div> .triangle { width: 0; height: 0; border-width: 20px; border-style: solid; border-color: red transparent transparent; } …will create a downward pointing, red triangle. By varying the width, height, border-width, border-style, and border-color values you can produce different shapes and control their orientation and colour. For more information, be sure to read Jon Rogan’s summary of the technique. The more advanced pseudo-element hacks use the extra background canvas afforded by each :before and :after pseudo-element. This can help you crop background images, control the opacity of background images, and ‘fake’ multiple backgrounds and borders in browsers without support for CSS3 multiple backgrounds (e.g., IE 8). Taken to ludicrous extremes, you can even build a whole CSS icon set. To start with, let’s look at some simple effects that can be created without images or presentational HTML. Creating CSS speech bubbles In this example, a quote is styled to look like a speech bubble, using CSS. This is done by creating a triangle using a pseudo-element, and then absolutely positioning it in the desired place. By adding position:relative to the CSS styles for the HTML element, you can absolutely position the :after pseudo-element relative to its associated element. <div class="quote">[Quoted text]</div> .quote { position: relative; width: 300px; padding: 15px 25px 20px; margin: 20px auto; font: italic 26px/1.4 Georgia, serif; color: #fff; background: #245991; } .quote:after { content: ""; position: absolute; top: 100%; right: 25px; border-width: 30px 30px 0 0; border-style: solid; border-color: #245991 transparent; } There’s nothing stopping you from adding some CSS3 to further enhance the effect for capable browsers. This could be adding rounded corners to the box or applying a skew transform to the triangle itself. Fiddle with the code in this example. Creating CSS ‘ribbons’ Using the same principle, you can create a CSS ribbon effect without images or extra HTML. This time the effect uses 2 pseudo-element triangles. The HTML fragment is still very simple. <div class="container"> <h1>Simple CSS ribbon</h1> <p>[other content]</p> </div> You then need to use negative margins to pull the h1 outwards so that it extends over the padding and beyond the boundaries of the container div. The HTML fragment above can be styled using the following CSS: .container { width: 400px; padding: 20px; margin: 20px auto; background: #fff; } .container h1 { position: relative; padding: 10px 30px; margin: 0 -30px 20px; font-size: 20px; line-height: 24px; font-weight: bold; color: #fff; background: #87A800; } From here, you only need to add the pseudo-element triangles to create the ‘wrapping’ appearance associated with ribbons. The :before and :after pseudo-elements share many styles, so you can simplify the code by only overriding the styles that differ between the two. In this case, the triangle created with the :after pseudo-element must appear on the opposite side of the heading, and will be a mirror image of the other triangle. So you need to override the shared styles that control its position and orientation. .container h1:before, .container h1:after { content: ""; position: absolute; top: 100%; left: 0; border-width: 0 10px 10px 0; border-style: solid; border-color: transparent #647D01; } /* override shared styles */ .container h1:after { left: auto; right: 0; border-width: 0 0 10px 10px; } Fiddle with the code in this example. Creating CSS folded corners The final example of this form of pseudo-element hack creates a simple CSS folded-corner effect. A pseudo-element’s border properties are set to produce two differently-coloured touching triangles. One triangle is a slightly darker or lighter shade of the box’s background colour. The other triangle matches the background colour of the box’s parent (e.g. white). The pseudo-element is then positioned in the top right corner of its associated element to complete the effect. .note { position: relative; padding: 20px; margin: 2em 0; color: #fff; background: #97C02F; } .note:before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 16px 16px 0; border-style: solid; border-color: #658E15 #fff; } Varying the size of the borders will vary the size and angle of the folded-corner. Fiddle with the code in this example. Pseudo background-crop Although creating polygons with pseudo-elements can produce some popular effects without images, the possibilities are inherently limited. But this is only one type of :before and :after pseudo-element hack. Treated as extra background canvases, they can be used to fill some gaps in existing browser support for CSS features. One of those features is the cropping of background images. In the future, it’s likely that you’ll be able to crop background images using fragment identifiers, as is proposed in the CSS Image Values Module Level 3 draft. But at the moment no browsers support the use of fragment identifiers with bitmap images. Until they do, you can make use of this CSS 2.1 hack to emulate background image cropping in modern browsers. The principle behind a ‘pseudo background-crop‘ is to apply a background-image to a pseudo-element rather than directly to an element in the HTML document. One of the applications of this technique is to crop icons that are part of a sprite. For example, a web app might allow users to ‘save’, ‘edit’, or ‘delete’ an item. The HTML involved might look something like this: <ul class="actions"> <li class="save"><a href="#">Save</a></li> <li class="edit"><a href="#">Edit</a></li> <li class="delete"><a href="#">Delete</a></li> </ul> To enhance the appearance of these ‘action’ links, it is common to see icons sitting alongside the anchor text. For argument’s sake, let’s say that the relevant icons are part of a sprite that is organised using a 16px × 16px grid. The :before pseudo-element – with dimensions that match the sprite’s grid unit – can be used to crop and display each icon. The sprite is referenced as a background image and the background-position property is used to control the precise positioning of each icon to be shown. .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 0; } .edit a:before { background-position: -16px 0; } .delete a:before { background-position: -32px 0; } Using pseudo-elements like this helps to avoid the need to either add liberal amounts of white space to sprites or use empty HTML elements to do the cropping. Fiddle with the code in this example. Pseudo background-position The CSS 2.1 specification limits the values of background-position to horizontal and vertical offsets from the top-left corner of an element. The CSS Backgrounds and Borders Module Level 3 working draft includes an improvement to the background-position property to allow offsets to be set from any side. However, Opera 11+ is currently the only browser to have implemented it. But by using pseudo-elements, it’s possible to emulate positioning a background image from any side in any browser with adequate CSS 2.1 support –’pseudo background-position‘. Once a pseudo-element is created, it must be absolutely positioned in front of the associated element’s background but behind its content, so as not to prevent users from being able to select text or click on links. This is done by setting a positive z-index on the element and a negative z-index on the pseudo-element. #content { position: relative; z-index: 1; } #content:before { content: ""; position: absolute; z-index: -1; } Now the pseudo-element can be sized and positioned to sit over any area within (or beyond) the element itself, without affecting its content. This is achieved by using any combination of values for the top, right, bottom, and left positional offsets, as well as the width, and height properties. It is the key to their flexibility. In this example, a 200px × 300px background image is applied to the pseudo-element, which is also given dimensions that match those of the image. Since the pseudo-element is absolutely positioned, it can be offset from the bottom and right of the associated HTML element. #content { position: relative; z-index: 1; } #content:before { content: ""; position: absolute; z-index: -1; bottom: 10px; right: 10px; width: 200px; height: 300px; background: url(image.jpg); } Many other hacks and effects are possible using the :before and :after pseudo-elements, especially when combined with CSS3. Hopefully this introduction to pseudo-elements, and how they can be exploited, will have inspired you to experiment with them in your work. The future of pseudo-elements The way that pseudo-elements are used will continue to change as CSS does. Some new applications will emerge, and existing ones will fade away as browser implementation of ‘CSS3 modules’ continues to improve. Generated content and pseudo-elements themselves are likely to undergo changes too. The CSS3 Generated and Replaced Content Module introduced a two-colon format for pseudo-elements (i.e., ::before) to help distinguish between pseudo-classes and pseudo-elements. But for compatibility with previous levels of CSS, pseudo-elements do not require two colons. Most modern browsers support both formats, but it is not supported by IE 8 and the single-colon format ensures greater backwards compatibility. The proposed extensions to pseudo-elements included the addition of nested pseudo-elements (::before::before), multiple pseudo-elements (::after(2)), wrapping pseudo-elements (::outside), and the ability to insert pseudo-elements into later parts of the document (::alternate). However, the CSS3 Generated and Replaced Content Module is undergoing significant changes. This article was originally published in .net magazine in April 2011 Related resources Interactive examples of the code throughout this article CSS generated content techniques Automatic numbering with CSS counters CSS image replacement using pseudo-elements Multiple backgrounds and borders with CSS 2.1 CSS background image hacks A whole bunch of amazing stuff pseudo-elements can do Full Article
el “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
el Coronavirus | Lockdown chokes Maharashtra’s economic lifeline By www.thehindu.com Published On :: Sat, 09 May 2020 02:29:44 +0530 The industrial hub faces a massive shortfall in revenues amid growing cost of combating the pandemic Full Article Other States
el Teltumbde in judicial custody till May 22 By www.thehindu.com Published On :: Sat, 09 May 2020 01:47:19 +0530 A special National Investigation Agency (NIA) court on Friday extended the judicial custody of academician Dr. Anand Teltumbde, arrested on April 14 i Full Article Other States
el IndiGo helps 227 Kenyans go home By www.thehindu.com Published On :: Sat, 09 May 2020 01:52:35 +0530 Airline brings them to Mumbai airport Full Article Other States
el No fees for medical screening, Maharashtra tells HC By www.thehindu.com Published On :: Sat, 09 May 2020 02:19:48 +0530 Court wants decision on levying costs for transport of migrant workers Full Article Other States
el Coronavirus | Assam rights activist held for social media post By www.thehindu.com Published On :: Sat, 09 May 2020 03:26:43 +0530 Rupa Rani Bhuyan, assistant professor of Mangaldoi College, was held for “misbehaving” with the police and “obstructing” them from investigating cases against her Full Article Other States
el Muslim villagers help Hindu woman's last rites By www.assamtimes.org Published On :: Thu, 26 Mar 2020 11:38:47 +0000 Full Article
el Working women beaten up in paddy field By www.assamtimes.org Published On :: Mon, 30 Mar 2020 03:59:44 +0000 Full Article
el Akhil Gogoi held in new case By www.assamtimes.org Published On :: Wed, 01 Apr 2020 09:05:25 +0000 Full Article
el Lockdown washes away watermelon prospect By www.assamtimes.org Published On :: Mon, 06 Apr 2020 12:32:25 +0000 Full Article
el MASS condemn arrest of Gautam Navalakha and Anand Teltumbe By www.assamtimes.org Published On :: Thu, 16 Apr 2020 12:00:11 +0000 Full Article
el Legislators named in delimitation panel By www.assamtimes.org Published On :: Thu, 07 May 2020 10:35:18 +0000 Full Article
el Guwahati likely to slip into orange zone By www.assamtimes.org Published On :: Fri, 08 May 2020 09:57:30 +0000 Full Article
el The stirring of soul in the workplace [electronic resource] / Alan Briskin By prospero.murdoch.edu.au Published On :: Briskin, Alan, 1954- Full Article
el 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
el Stranded in the Nyiri Desert [electronic resource] : a group case study / Matthew J. Drake ; Aimee A. Kane and Mercy Shitemi By prospero.murdoch.edu.au Published On :: Drake, Matthew, author Full Article
el 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
el 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
el 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
el 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