General > Off-Topic
MOTD Setup inquiry
TwinbladeTM:
I would like to know whether it is possible for the MOTD to be set up using CSS. It's my understanding that GMod doesn't like .htm files, and I have a limited understanding of CSS...What I'm ultimately looking for is a Web template that I can use in the MOTD, to give it a nicer look than the stock MOTD. Any Suggestions?
[WCA]AIDS:
CSS is just a list that defines params for styles and classes. For the most part the html interpreter used by the motd function will understand html, some dhtml, css, and a very little bit of java. If you would like me to build you an motd I certainly will, just shoot me off a pm and we'll get things set up.
Anyways, back to your original query. Yes, it is possible for the motd to use styles defined in css.
motd.txt
--- Code: ---<html>
<head>
<script type="text/css">
#body {
background: #FFFFFF;
}
#topbar { width: 80%; height: 50px; background: #009900; margin-left: auto; margin-right: auto; }
</script>
</head>
<body>
<div style="topbar"> Lolsup </div>
I liek tuwtals
</body>
</html>
--- End code ---
JamminR:
The text inside of ulx_motd.txt is actually HTML.
As for CSS, or any HTML, it all depends on what the actual Source html interpreter allows, not Gmod itself.
Unless it's been improved in the past 2 years, Source html interpreter is very limited as to what it allows.
I've used CSS within the motd html before, but I put it inline using the style tag, not a separate file.
You may use a separate CSS file, but only if you host it on a publicly accessable web server and use the <link> tag to link to it.
Attempting to use locally stored images/files within the Source html won't work.
TwinbladeTM:
OK, so I would like to have the CSS code embedded in the .txt, how would go about doing that?
This is what the beginning of my code looks like...it's pretty much greek to me. :/ And do I need the metatags? It was originally part of a template I have.
--- Code: ---html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>MOTD</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
--- End code ---
JamminR:
This topic is really going past what this forum area was meant to be...support of ULX, ULib (and occasionally, other Ulysses releases) - Hence why I moved it.
The link tag, which includes the href=<local file.css> won't work in Source html interpreter UNLESS you're hosting that file on a web server. You can't (easily) link to a local css file, which I just said in previous post.
You would need to open the css file you have, and teach yourself how to include it INSIDE the original html file using the <style> tag.
Navigation
[0] Message Index
[#] Next page
Go to full version