SVG Scaling Text to fit container

If you really don’t care that the text gets ugly, here’s how to fit unknown length text into a known width. <svg width=”436″ height=”180″ style=”border:solid 6px” xmlns=”http://www.w3.org/2000/svg”> <g> <text y=”50%” textLength=”436″ lengthAdjust=”spacingAndGlyphs”>UGLY TEXT</text> </g> </svg>

Is div inside list allowed? [duplicate]

Yes it is valid according to xhtml1-strict.dtd. The following XHTML passes the validation: <?xml version=”1.0″?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /> <title>Test</title> </head> <body> <ul> <li><div>test</div></li> </ul> </body> </html>

How do I resolve entities when loading into an XDocument?

This is a collaboration of msdn and blog postings. XDocument document; using (var stringReader = new StringReader(output)) { var settings = new XmlReaderSettings { ProhibitDtd = false, XmlResolver = new LocalXhtmlXmlResolver(bool.Parse(ConfigurationManager.AppSettings[“CacheDTDs”])) }; document = XDocument.Load(XmlReader.Create(stringReader, settings)); } private class LocalXhtmlXmlResolver : XmlUrlResolver { private static readonly Dictionary<string, Uri> KnownUris = new Dictionary<string, Uri> { { … Read more

CSS @font-face not working in ie

I read a lot of tutorials that suggested hacks, so I came up with this solution I think is better… It seems to work fine. @font-face { font-family: MyFont; src: url(‘myfont.ttf’); } @font-face{ font-family: MyFont_IE; src: url(‘myfont.eot’); } .my_font{ font-family: MyFont, MyFont_IE, Arial, Helvetica, sans-serif; }

HTML 5 versus XHTML 1.0 Transitional?

HTML5 is so much easier to write than XHTML 1.0. You don’t have to manually declare the “http://www.w3.org/1999/xhtml” namespace. You don’t have to add type attributes to script and style elements (they default to text/javascript and text/css). You don’t have to use a long doctype where the browser just ignores most of it. You must … Read more

HTML list-style-type dash

There is an easy fix (text-indent) to keep the indented list effect with the :before pseudo class. ul { margin: 0; } ul.dashed { list-style-type: none; } ul.dashed > li { text-indent: -5px; } ul.dashed > li:before { content: “-“; text-indent: -5px; } Some text <ul class=”dashed”> <li>First</li> <li>Second</li> <li>Third</li> </ul> <ul> <li>First</li> <li>Second</li> <li>Third</li> … Read more

How to show live preview in a small popup of linked page on mouse over on link?

You can use an iframe to display a preview of the page on mouseover: .box{ display: none; width: 100%; } a:hover + .box,.box:hover{ display: block; position: relative; z-index: 100; } This live preview for <a href=”https://en.wikipedia.org/”>Wikipedia</a> <div class=”box”> <iframe src=”https://en.wikipedia.org/” width = “500px” height = “500px”> </iframe> </div> remains open on mouseover. Here’s an example … Read more