473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

re children and inheritence

Hi

still playing around with css, now I want to place say a box which in
inference from <pre> formatted

samplecode {
font-family: monospace;
border-style: solid solid solid solid;
border-width: thin thin thin thin;
float: left;
position: relative;
visibility: visible;
height: auto;
background-color: white;
}
Basically I am using this to place sample cpp code I tried

pre.samplecode

but am unsure how to address this in the html file, I want the box to be
relative to the paragraph above and the hight and width to be be
relative to the text inside

hope this is not too vague

regards

Adrian
Aug 17 '05 #1
5 1237
In article <UI******************@nntpserver.swip.net>, adrian suri writes:
still playing around with css, now I want to place say a box which in
inference from <pre> formatted

samplecode {
}
Basically I am using this to place sample cpp code I tried
I'd think that sample code would be better placed in a <CODE> element
than in a <PRE> element.
pre.samplecode

but am unsure how to address this in the html file,


<pre class="samplecode">, if I understand your question properly.

--
Michael F. Stemper
#include <Standard_Disclaimer>
A bad day sailing is better than a good day at the office.

Aug 17 '05 #2
Op Wed, 17 Aug 2005 12:06:33 -0500 schreef ms******@siemens-emis.com
(Michael Stemper):

I'd think that sample code would be better placed in a <CODE> element
than in a <PRE> element.


But then you would need some ccs like:

code{
font-family: monospace;
white-space: pre;
}

(or append each line of code-text with a <br>, wich is rather
cumbersome)

and IE (that is 5.5, don't know about the other versions) does not
support the white-space part of this css declaration.
Semantically indeed it belongs in a <code> </code> block, but to make
life a little easier I suggest using
<pre>
<code>
... your .cpp code
</code>
</pre>

At leat that's how I did it here:
http://home-1.tiscali.nl/~knmg0017/c...m#obfuscated_c

Bart
--
Bart Broersma
br*********************@tiscali.nl
(ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)
Aug 17 '05 #3
On Wed, 17 Aug 2005, Michael Stemper wrote:
I'd think that sample code would be better placed in a <CODE> element
than in a <PRE> element.


Maybe I'll provoke some hefty counterblast for this, but if it's the
kind of code that's conventionally presented in a fixed format, I
wouln't be shy to mark it up with <pre> *and* <code>.
Aug 17 '05 #4
Hi

tried code but since I am using lots of these to highlight etc key words
it mucks up, anyway
I got it working using
pre.samplecode
{
border-style: solid solid solid solid;
border-width: thin thin thin thin;
float: left;
visibility: visible;
height: auto;
background-color: white;
font-family: monospace;
position: relative;
padding-left: 2pt;
width: 50em;
Font-style: normal;
Border-color: black;

}
the problem now is I wanted the text to wrap around this this, which it does
but I can't gt padding to give some space between, I upload the file if
anyone cares to look
http://home.swipnet.se/virtpub/lang/cpp/lessons/
look for this middle of the page
//File name: cstring.cpp
// example code using c string ie an array of char
// By Adrian Suri 2005-06-20 15.21.29
#include Iostream
using namespace std;
#include<cstring>// included for string manipulation functions
#include<cstdlib>// includes clear screen, exit functions etc
int main() {
const int arrSize=30; //constant can't be changed
charfirstName[arrSize];
char lastName[arrSize]; // set up arr of char for full name
char country[arrSize];
adrian

Alan J. Flavell wrote:
On Wed, 17 Aug 2005, Michael Stemper wrote:

I'd think that sample code would be better placed in a <CODE> element
than in a <PRE> element.

Maybe I'll provoke some hefty counterblast for this, but if it's the
kind of code that's conventionally presented in a fixed format, I
wouln't be shy to mark it up with <pre> *and* <code>.

Aug 18 '05 #5
adrian suri <as**************@tele2.se> in news:UIHMe.24988$hV3.9494
@nntpserver.swip.net:
hope this is not too vague


probably simpler than estate tax code. :-)
(yeah, no doubt an old pun...)
Aug 24 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
Hi, I am trying to create a class heirarchy similar to the following: // base interface class ICar { public: virtual void start() = 0; }; // add members to that interface, but retain base...
8
by: Digital Puer | last post by:
I made the following table to help me (re)learn inheritence basics. Can someone check if it's correct? This table requires a courier-like font. Java C++ ---- ...
5
by: john bailo | last post by:
For a c# web application, I created a user control that includes a form in control. The idea is, on the main Page, when the user clicks Submit from the master form, that makes the user control...
0
by: Jan Elbęk | last post by:
Hi, I would like to make a base form in my project - which (almost) all forms must inherit from. The baseform must have some visible elements (a toolbar, a topaligned panel and a picturebox and...
7
by: preetam | last post by:
Hi, This question is more towards design than towards c++ details. By looking at books on design patterns and various google threads on the same topic, I see that composition is favoured to...
1
by: Todd Cary | last post by:
In my previous post, I stated that some JavaScript I inherited does not work in Firefox but does work in IE 6 . I have now isolated a line where it fails in Firefox; the line with the property of...
6
by: Luke Dalessandro | last post by:
I'm not sure if this is the correct forum for platform specific (Mozilla/Firefox) javascript problems, so just shout and point me to the correct newsgroup if I'm being bad. Here's the deal... ...
0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
5
by: Neelesh Bodas | last post by:
This might be slightly off-topic. Many books on C++ consider multiple inheritence as an "advanced" concept. Bruce Eckel says in TICPP, volume 2 that "there was (and still is) a lot of...
9
MrPickle
by: MrPickle | last post by:
I have a structure like so: struct node { float x, y, z; std::vector<node> children; }; and I want to loop through all the node's children, then all the children's children then all the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.