html - Force background to draw on till end of line -


I have a custom tag ab that is defined, so I want to black How do I get the line behind drawing the text till the end of the line?

add ab {display: block; } Demos for CSS:

Unknown elements are inline by default ( display: inline ).

If you want styling to work in Internet Explorer 8 and older versions, you will need to use some javascript. In response to Karl Nicole, a solution has been described in such a way that the screen will work for the media, but still can not be enabled for the print media. If you want, then you can use this revised version of the IE Print Protector You can use:

  / *! Iepp v1.6.2 mit @ zon_eagle * / (function (k, o) {var a = 'ab', f = a.split ('|'), d = f.length, b = new regx ('(| \\ s) ('+ a +' ',' gi '), h = new RegExp (' & lt; (/ *) ('+ a +' '', 'gi'), m = new regx '(' | [^ \\ n] * \\ s) ('+ one +') ([^ \\ n] *) ({[\\ n \\ w \\ w] *?}), 'G'?), P = o.createDocumentFragment (), i = o.documentElement, n = i.firstChild, c = o.createElement ('body'), g = o.createElement ('style'), j; Function a (r)) {var q = -1; while (++ q  l) vi {if (s [q] .className.indexOf ('iepp -') 0) {s [q] .className + = 'iepp -' + f [r] }}} P.appendChild (j); I.appendC HILD (c); C.className = j.className; C.innerHTML = j.innerHTML.replace (h, '& lt; $ 1font')}); K.attachEvent ('onafterprint', function () {c.innerHTML = ''; I.removeChild (c); i.appendChild (j); g.style.Sheet.cssText = ''}}}} (This, Document)   

See where is var a = 'ab' ? You can add other elements there, as a separator | , e.g. var a = 'ab | Foo | Bar ' & lt; Ab & gt; , & lt; Foo & gt; and & lt; Bars & gt; Style.

Comments