Login | Register | FAQ
Anonymous

Guestbook entries left, news on the right HELP

+ Post a reply

7 posts Page 1 of 1


Guestbook entries left, news on the right HELP

by Ominous Omnivore » Tue Mar 13, 2012 2:31 am

Hi,
I'm not sure I can at all express my problem understandable, but I try.
I got my guestbookentries on the left side of the page, the news on the right.
But since I don't know the length of the comments I need to set every but the
first element with margin. That works fine with the guestbook on the left.
But however I try it, the news (on the right) keep calculating
their position from the last displayed guestbook entry.
I can set the first element with absolute positioning, but as explained that's not
possible with the following.
I tried tables, nested tables, float and div ids but it simply doesn't work, the news keep
depending on the guestbookentries.
Is it possible I need java script for this? I am totally new to everything, and at a loss.

I am posting the script for the last two entries (first displayed) of either:
(That's the basic form of my last try, I removed the div ids)


<?php

mysql_connect("localhost", "root", "") or die (mysql_error ());

mysql_select_db("mydatabase") or die(mysql_error());

$rs = mysql_query("SELECT * FROM gästebuch ORDER BY id DESC LIMIT 1");

while($row = mysql_fetch_array($rs)){

?>

<h1><?php echo $row['Author'] ?></h1>
<p><?php echo nl2br(wordwrap ($row['Inhalt'], 60,"<br> ",1));?></p>

<?php
}
mysql_close();
?>
<?php

mysql_connect("localhost", "root", "") or die (mysql_error ());

mysql_select_db("mydatabase") or die(mysql_error());

$rs = mysql_query("SELECT * FROM gästebuch ORDER BY id DESC LIMIT 1,1");

while($row = mysql_fetch_array($rs)){

?>

<h2><?php echo $row['Author'] ?></h2>
<p><?php echo nl2br(wordwrap ($row['Inhalt'], 60,"<br> ",1));?></p>

<?php
}
mysql_close();
?>

<?php

mysql_connect("localhost", "root", "") or die (mysql_error ());

mysql_select_db("mydatabase") or die(mysql_error());

$rs = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 1");

while($row = mysql_fetch_array($rs)){

?>

<h11>Tuchumfasster gewölbefreier Raum</h11>
<p2><?php echo nl2br(wordwrap ($row['Inhalt'], 80,"<br> ",1));?></p2>

<?php
}
mysql_close();
?>

<?php

mysql_connect("localhost", "root", "") or die (mysql_error ());

mysql_select_db("mydatabase") or die(mysql_error());

$rs = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 1,1");

while($row = mysql_fetch_array($rs)){

?>

<h12>Tuchumfasster gewölbefreier Raum</h12>
<p2><?php echo nl2br(wordwrap ($row['Inhalt'], 60,"<br> ",1));?></p2>

<?php
}
mysql_close();
?>



I am thankful for any kind of input...
User avatar

Ominous Omnivore

  • Posts: 18
  • Joined: Wed Feb 29, 2012 10:19 pm

Re: Guestbook entries left, news on the right HELP

by Ominous Omnivore » Tue Mar 13, 2012 2:54 am

Just thought I should maybe add my css thats of each first headline + content (text):

Guestook precisely as I want it:


h1
{
background-color:#cd950c;
width:500px;
padding-bottom: 0px;
padding-top:15px;
padding-left:15px;
margin-top: 103px;
margin-bottom: 0px;
color: #cd2626;
font-style: normal;
font-weight: bold;
font-size: 18px;
font-family: arial, sans-serif;
}

p {
background-color:#cd950c;
width:500px;
padding-bottom: 15px;
padding-top:5px;
padding-left:15px;
margin-top: 0px;
padding-bottom:15px;
color: #000000;
font-style: normal;
font-weight: bold;
font-size: 14px;
font-family: arial, sans-serif;
}




News totally fucked up (absolute positioned headline where it should be, content floating
senseless to the right, in one height with the end of my last displayed guestbookentry):

h11
{
background-color:#000000;
width:500px;
padding-bottom: 0px;
padding-top:15px;
padding-left:15px;
position:absolute;
top: 155px;
left: 1078px;
color: #cd2626;
font-style: normal;
font-weight: bold;
font-size: 18px;
font-family: arial, sans-serif;
}

p2
{
background-color:000000;
width:500px;
padding-bottom: 15px;
padding-top:5px;
padding-left:15px;
margin-top: 0px;
padding-bottom:15px;
float:right;
color: #cd950c;
font-style: normal;
font-weight: bold;
font-size: 14px;
font-family: arial, sans-serif;
}

I'm in dispair...
User avatar

Ominous Omnivore

  • Posts: 18
  • Joined: Wed Feb 29, 2012 10:19 pm

Re: Guestbook entries left, news on the right HELP

by chrisf1288 » Tue Mar 13, 2012 4:26 pm

I've never heard of <h12> and <h11>. The heading tags only go from <h1> to <h6>. Try using one of those.
User avatar

chrisf1288

  • Posts: 128
  • Joined: Sun Jun 26, 2011 1:01 am

Re: Guestbook entries left, news on the right HELP

by Ominous Omnivore » Tue Mar 13, 2012 9:23 pm

That was still a corpse from my last try, I did'nt use head tags at all originally.
But I found all I was missing out was "valign: top" and going back to the nested
tables. Thanks a lot for reading though and good to know for the future that 20
headers can't be the solution :-)
User avatar

Ominous Omnivore

  • Posts: 18
  • Joined: Wed Feb 29, 2012 10:19 pm

Re: Guestbook entries left, news on the right HELP

by Ominous Omnivore » Wed Mar 14, 2012 3:22 am

Thanks a lot.
It somehow didn't work with divs (had probably something wrong), but it works nicly with
old fashioned html tables, one for left, one for right, one around.
It took me damned long to find out about "valign: top", it's
of course everything quite simple again once found, but it always takes me time to
find the right question.

What keeps bugging me is that if I display those two there is a gap inbetween I can't
eliminate (or only by weird measures like 0 line-height) :

<p1><?php echo $row['Author'] ?></p1>
<p><?php echo nl2br(wordwrap ($row['Inhalt'], 60,"<br> ",1));?></p>

but not between those two:

<p3>Tuchumfasster gewölbefreier Raum</p3><br />
<p2><?php echo nl2br(wordwrap ($row['Inhalt'], 60,"<br> ",1));?></p2>

The first one does not only the <br> automatically, it also adds some additional space.
Everything around them is absolutely identical. Funny enough, if I name 'p2' also 'p'
the gap appears. But if I use 'p2' with an identical css it's gone again.

But it's not a real problem since the weird measures work. (I'm just always suspicious how it's
gonna look in another browser, when I do something I don't get, but I guess the day of truth will
come when I use a validator).
User avatar

Ominous Omnivore

  • Posts: 18
  • Joined: Wed Feb 29, 2012 10:19 pm

Re: Guestbook entries left, news on the right HELP

by Ominous Omnivore » Thu Mar 15, 2012 10:31 am

I used p1 and p2 for assigning different colors to author and entry?
I know I do stuff complicated (a lot), but often I don't think
of an easy solution so I always stick to things that worked earlier.
I tried it with the divs again and now, that also works. I read
before that people don't use tables for anything but tabular data
anymore.
I still don't entirely get why, but since I half of the time don't
really know what I am doing, I succumb to the wiser judgement of those
who do know.
Thanks again so much for bearing with me, it must be a really hard
to go through my collection of vague expressions, to find out what
my problem is. I hope I'm gonna be able to express myself more precisly
soon.
User avatar

Ominous Omnivore

  • Posts: 18
  • Joined: Wed Feb 29, 2012 10:19 pm

Re: Guestbook entries left, news on the right HELP

by Ominous Omnivore » Thu Mar 15, 2012 10:56 pm

Thank you again that link was really helpful. I wasn't aware that I might be already at a point in my
process where I should start thinking about how to upload it. But since that seems also to make
the validation of my files much easier I should really start looking for a host and organize them
properly. Since I put by now easily 200 hours of work in it, I get more and more anxious about
the question if it's gonna work out online and in different browsers (already noticed severe difference
in firefox and chrome myself). Big thanks once more at you, this page, all in the forum and online
supporting newbies in general.
User avatar

Ominous Omnivore

  • Posts: 18
  • Joined: Wed Feb 29, 2012 10:19 pm


+ Post a reply

Page 1 of 1

?>