CSS Datei programmieren - Syntax prüfen

(Firma: egal) #6998657
Lesenswert?
• ▲
▼
CSS schrieb:
> beim ausführen der Datei

Da wird überhaupt nichts ausgeführt. Dein Webbrowser sucht sich abhängis 
vom jeweiligen HTML-Code die darin enthaltenen Formatanweisungen raus 
und verwendet diese. Du kannst zuegs in deine CSS-Datei reingeschrieben 
(da wird auch nicht programiert sondern nur beschrieben) haben das 
überhaupt nicht verwendet wird und dabei nochnicht mal stört. Dazu kommt 
noch das unterschiedliche Browser das teilweise auch noch 
unterschiedlich interpretieren. Am ende hilft nur mitr den gewünschten 
Browser ausprobieren ob deine Seite so aussieht wie du es haben willst.

Ansonsten mal hier probieren:
- https://validator.w3.org/
Gast #6999234
Lesenswert?
• ▲
▼
> Kennt jmd Debugger

Wenn du nur diese Beschreibungssprachen alleine hast, kannst du ja nur 
die Syntax überprüfen. Ob das XML zur DTD passt, zeigt dir jeder 
XML-Editor.

Willst du einen Debugger, mit dem du heraus finden kannst, warum für ein 
XML Element das falsche CSS benutzt wird? Falls du das CSS in einen 
Browser benutzt, hast du Glück. Der F12 Debugger ist da recht hilfreich. 
Aber wenn du mit einem c++ Debugger heraus finden musst, warum die Qt 
das falsche CSS benutzt - viel Spass!
Gast #6999270
Lesenswert?
• ▲
▼
CSS schrieb:
> beim ausführen
oder davor??

Ausgabe
1
URI : TextArea
2
3     Value Error : background-color greenb is not a background-color value : greenb
3
5     Value Error : border Unknown dimension 1pxx
4
15     Parse Error -.one { background-color: red; border: none !important; }
5
35     Parse Error div { font-size: 30px; color: white; background-color: yellow; margin: 10px; }//=SCHLIESSENDE KLAMMER FEHLT

https://jigsaw.w3.org/css-validator/
Gast #7000028
Lesenswert?
• ▲
▼
1.  body {
2.      max-width: 75em;
3.      margin: 0 auto;
4.    padding: 0 1em;
5.      font: normal 1em Arial, sans-serif;
6.    color: #555;
7.      background: #ggg;
8.    position:relative;
9.  }
10.
11.  header.banner {
12.    background: #fff;
13.    padding: .5em 1em;
14.    box-shadow: 0 0 10px rgba(0,0,0,0.2);
15.    border-radius: 0 0 1em 1em;
16.  }
17.
18.  header a#navlink {
19.    display: block;
20.    fluent: right;
21.    color: #88a600;
22.    text-decoration: dotted;
23.    font-size: 2em;
24.    font-weight: bold;
25.  }
26.
27.  main {
28.    spacing: 1em;
29.    background: #fff;
30.    box-shadow: 0 0 10px rgba(0,0,0,0.2);
31.    border-radius: 1em;
32.  }
33.
34.  a {
35.    color: #97b314;
36.  }
37.
38.  a-hover,
39.  a-focus {
40.    background: rgba(195,214,106,0.95);
41.    color: #708900;
42.  }

meine Frage bezog sich darauf:
wenn ich hier die Syntaxehler suche, welches Tool unterstützt mich 
dabei?
#7000064
Lesenswert?
• ▲
▼
Schau dir mal https://scout-app.io/ an. Das ist ein Compiler, um SCSS zu 
CSS zu übersetzen. SCSS ist eine Metasprache, um CSS zu generieren. Aber 
SCSS ist auch nur eine Erweiterung von CSS, so dass du ganz normale 
CSS-Dateien "kompilieren" kannst. Die App zeigt dir dann jeden Fehler 
an.

Step 2: Verwende für deine Projekte SCSS und lass das CSS generieren. 
Ist nicht kompliziert, vereinfacht aber einiges.

https://de.wikipedia.org/wiki/Sass_(Stylesheet-Sprache)#SCSS-Syntax
Gast #7000200
Lesenswert?
• ▲
▼
CSS schrieb:
> meine Frage bezog sich darauf:
> wenn ich hier die Syntaxehler suche, welches Tool unterstützt mich
> dabei?

Bin mit css nicht sehr vertraut, aber vorgeschlagenes Onlinetool/java 
cmdline-tool hat paar Fehler gefangen

ojo schrieb:
> https://jigsaw.w3.org/css-validator/

Aber da könnte vielleicht ein Kompiler, wie von Dirk vorgeschlagen, viel 
umfassendere Überprüfung bieten

##########################################################
1
Sorry! We found the following errors (3)
2
URI : TextArea
3
7     Value Error : background #ggg is not a background-color value : #ggg
4
20     Property fluent doesn't exist : right
5
28     Property spacing doesn't exist : 1em
6

7
Warnings (5)
8
URI : TextArea
9
6     You have no background-color set (or background-color is set to transparent) but you have set a color. Make sure that cascading of colors keeps the text reasonably legible.
10
12     You have no color set (or color is set to transparent) but you have set a background-color. Make sure that cascading of colors keeps the text reasonably legible.
11
21     You have no background-color set (or background-color is set to transparent) but you have set a color. Make sure that cascading of colors keeps the text reasonably legible.
12
29     You have no color set (or color is set to transparent) but you have set a background-color. Make sure that cascading of colors keeps the text reasonably legible.
13
35     You have no background-color set (or background-color is set to transparent) but you have set a color. Make sure that cascading of colors keeps the text reasonably legible.
Gast #7000378
Lesenswert?
• ▲
▼
CSS schrieb:
> meine Frage bezog sich darauf:

Nein, tut sie nicht. Du hast eine Fehleranalyse zur Laufzeit gesucht, 
nicht während der Entwicklung. Willst du uns gezielt in die Irre führen?

CSS schrieb:
> mit dem ich beim ausführen der Datei die Syntax auf
> Fehler prüfen kann?

Was soll "ausführen" denn sonst heissen? Entwicklungstools hast du damit 
definitiv ausgeschlossen.

Fall erledigt.

Georg

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren