Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TGML Type Display!! Pls Help 1

Status
Not open for further replies.

Forri

Programmer
Oct 29, 2003
479
MT
Hi All

I would like to show some content in the same manner that this site's great TGML parser does:

Code:
 test

How can i do the above?

Thanks
Nick
 
Are you looking just for visual appearance? Then you could just look at the source:
Code:
<style type="text/css">
.code {
	margin: 15px 20px 15px 20px;
	border-width: 2px;
	border-style: inset;
}
.code h4 {
	font-size: 10px;
	background-color: #777;
	color: white;
	font-weight: bold;
	text-transform: uppercase;
	padding: 1px 2px 2px 4px;
	border: 0px;
	margin: 0px;
}
.code .body {
	padding: 5px;
	font-family: monospace;
	background-color: #FFFFFF;
}
.code .body div, #code .body span {
	font-family: monospace;
}
</style>

<div class="code">
  <h4>CODE</h4>
  <div class="body">
    test
  </div>
</div>
If it is the transformation you are after, then you need to look at the server-side solution for whatever language you are using.
 
fantastic vragabond! great...i'm not too good with css! great job cheers...star for you!

Nick
 
Last 2 questions:

1) How can i make the content within the body all the same font. The reason i'm asking this is because i'm retrieving data from a WYSIWYG editor and they can change font and size and make bold etc.. The Bold is ok but the fonts i cannot allow!

2) I would like to make the box wider!?


Thanks again
Nick
 
2. The box should be as wide as the container expect for the margins. It is as wide as the container you put it in (if on a new page, then it should be browser window) and made smaller by 20px on each side (check the second and fourth declaration in margin). The only way to make it even wider is to change that 20px to 0px. In that case, it is basically 100% wide.

1. This depends on your editor. Usually, WYSIWYG editors put ugly <font></font> tags into the code. Font tag will always override any declaration you already have, except if you add css to font tag itself. So try this code in your css:
Code:
/* all the fonts in the page are normal 1em verdanas */
body {
	font: normal 1em verdana, sans-serif;
}

/* every font tag has a font-family verdana */
font {
	font-family: verdana, sans-serif;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top