Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Anfänger-Probleme mit CSS

Empfohlene Antworten

Veröffentlicht

hallo!

ich versuche mich grade an css und habe da doch mehr schwierigkeiten als erhofft :(

ich will die formatierung in einer externen css-Datei ablegen. Mit der Überschriftenformatierung klappt das alles wunderbar:

css-File:

h2 {font-family:Arial,sans-serif; font-size:21px; margin-bottom:18px; font-weight:700}

html-File

<h2> Überschrift2 </h2>

Aber das ganze will ich dann auch mit dem "normalen" Text machen, da will ich 2, 3 verschiedene Vorlagen erstellen

z.B. :

Css-File

font1 {style= font-family:Comic; font-size:14px; color:#000000; font-weight:500 font-style:normal}

im HTLM-File sollte dass dann so aussehen:

<font1> blablablablabla </font1>

...das funktioniert aber nicht. Bin ich irgendwie auf dem Holzweg? Ich habe was gelesen dass h1 ein HTML-Element ist - wie wäre denn das analoge Element für den "normalen" Text?

Außerdem würde ich gerne wissen ob es möglich ist auch Tabellenwerte (width="100%" border="0") in css auszugliedern, wenn ja, wie sieht dann der Aufruf in der HTML Datei aus?

Muchas Gracias!

Hi,

der einfachste Weg, bin auch noch ganz frisch in CSS und HTMl etc, wäre wenn du um den Text, der in Deinem style erscheinen soll ein "<div class="font1"> Dein Text </div> setzt.

Hoffe ich konnte Dir damit weiterhelfen.Gruß

Kay

Man kann gernerell nur die Elemente formatieren, die auch in HTML existieren, es sei denn, man verwendet XML.

Ein Element mit Namen font1 ist mir nicht bekannt.

Vielleicht solltest du erst einmal HTML lernen und dich dann mit CSS beschäftigen!?

Wie schon angedeutet, geht sowas mit IDs bzw. Klassen. -> siehe http://de.selfhtml.org/css/formate/zentrale.htm

Der Tag für reinen Text wäre übrigens je nach Verwendungszweck <p> bzw. <span>.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.