Autor |
Nachricht |
aidschism
Threadersteller
Dabei seit: 26.11.2010
Ort: Köln
Alter: -
Geschlecht:
|
Verfasst Mo 27.05.2013 18:37
Titel (css) text wie mit textmarker hervorheben |
|
|
Hallo,
Ich habe einen Text mit Zeilenumbrüchen welcher einen farbigen Hintergrund bekommen soll.
Code: |
.zitat
{
font-family:Verdana, Geneva, sans-serif;
font-size:70px;
background-color:#F30;
text-align:right;
}
|
Problem ist, dass das Orange bereits links anfängt, also _nicht_ genau mit dem Text beginnt.
es sollen wirklich nur die einzelnen Buchstaben eine Hintergrundfarbe bekommen, nichts mehr.
So als ob ich es mit einem Textmarker markiert hätte (da fange ich ja auch nich genau an der Kante des Blattes an den text zu markieren )
danke!
|
|
|
|
|
pantonine
Dabei seit: 03.03.2011
Ort: gehen Sie bitte weiter…
Alter: -
Geschlecht: -
|
Verfasst Mo 27.05.2013 18:58
Titel
|
|
|
Tja, kommt halt drauf an, was Du formatierst. Ein Blockelement (was ja gewöhnlich text-align besitzt) ist nunmal auch optisch ein Block.
Für Zitate „kennt“ HTML übrigens echte, semantische Elemente. Sowohl Inline-, als auch Block-Typen.
Zuletzt bearbeitet von pantonine am Mo 27.05.2013 19:00, insgesamt 1-mal bearbeitet
|
|
|
|
|
Anzeige
|
|
|
m
Moderator
Dabei seit: 18.11.2004
Ort: -
Alter: -
Geschlecht:
|
Verfasst Mo 27.05.2013 21:55
Titel
|
|
|
Code: | <p><span>Lorem ipsum …</span></p> |
Code: | span { background: yellow; } |
http://codepen.io/pen/gHtDl
Zuletzt bearbeitet von m am Mo 27.05.2013 22:01, insgesamt 1-mal bearbeitet
|
|
|
|
|
pantonine
Dabei seit: 03.03.2011
Ort: gehen Sie bitte weiter…
Alter: -
Geschlecht: -
|
Verfasst Di 28.05.2013 00:30
Titel
|
|
|
Wie gesagt - es gibt weit bessere Elemente als ein span.
|
|
|
|
|
Karlarsch
Dabei seit: 05.02.2007
Ort: -
Alter: 58
Geschlecht:
|
Verfasst Di 28.05.2013 05:56
Titel
|
|
|
pantonine hat geschrieben: | Wie gesagt - es gibt weit bessere Elemente als ein span. |
Jupp, sogar eins, was genau für diesen Fall geschaffen wurde:
http://www.w3.org/wiki/HTML/Elements/mark
Gruß
Karl
|
|
|
|
|
m
Moderator
Dabei seit: 18.11.2004
Ort: -
Alter: -
Geschlecht:
|
Verfasst Di 28.05.2013 09:00
Titel
|
|
|
Klar, kann man machen. Hier wird aber nur erwähnt dass er text highlighten möchte, aus welchem Grund wird doch nicht deutlich? Er verliert kein Wort zur Semantik. Evtl ist strong viel passender als mark, interessant könnte das Beispiel sein:
Zitat: | The following example shows the difference between denoting the importance of a span of text (strong) as opposed to denoting the relevance of a span of text (mark). It is an extract from a textbook, where the extract has had the parts relevant to the exam highlighted. The safety warnings, important though they may be, are apparently not relevant to the exam.
<h3>Wormhole Physics Introduction</h3>
<p><mark>A wormhole in normal conditions can be held open for a
maximum of just under 39 minutes.</mark> Conditions that can increase
the time include a powerful energy source coupled to one or both of
the gates connecting the wormhole, and a large gravity well (such as a
black hole).</p>
<p><mark>Momentum is preserved across the wormhole. Electromagnetic
radiation can travel in both directions through a wormhole,
but matter cannot.</mark></p>
<p>When a wormhole is created, a vortex normally forms.
<strong>Warning: The vortex caused by the wormhole opening will
annihilate anything in its path.</strong> Vortexes can be avoided when
using sufficiently advanced dialing technology.</p>
<p><mark>An obstruction in a gate will prevent it from accepting a
wormhole connection.</mark></p> |
http://dev.w3.org/html5/spec-author-view/the-mark-element.html#the-mark-element
Aber mit einem span element macht man hier erstmal nichts falsch.
Zuletzt bearbeitet von m am Di 28.05.2013 09:06, insgesamt 1-mal bearbeitet
|
|
|
|
|
|
|
|
Ähnliche Themen |
PDF in Acrobat: Text hervorheben
Aktiven Menüpunkt hervorheben
aktiven link hervorheben
Momentanen Link hervorheben mit css und frames
Dreamweaver, Spry Menü:ausgewählten Menüpunkt hervorheben
Schriften gelöscht - Excel/Word Text Text nicht angezeigt
|
|