Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][HTML][CSS]data w jednej linii
Sueroski
post 7.02.2010, 20:21:31
Post #1





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 19.11.2008

Ostrzeżenie: (0%)
-----


Witam. Mam pewien problem z newsami na mojej stronie. W CSS jestem raczej kiepski (typowy programista PHP tongue.gif PHP proste, ale grafika rzecz niepotrzebna haha.gif ), więc pewnie wy na coś wpadniecie. Otóż, nie wiem jak w divie (który ma text-align: center; ) umieścić datę po prawej stronie. Na razie coś takiego wymyśliłem:
  1. <?php include('header.php'); ?>
  2. <?php
  3. include('config.php');
  4. $query = mysql_query("SELECT * FROM news;");
  5. while ($rekord = mysql_fetch_assoc($query)) {
  6. echo('<b>'.$rekord['name'].'</b><div style="text-align:right;">'.$rekord['date'].'</div><br />');
  7. $string = nl2br($rekord['text']);
  8. echo("$string");
  9. }
  10. ?>
  11. <?php include('footer.php'); ?>

ale data jest w nowej linii. Więc wiecie jak to zrobić w jednej linii?
Go to the top of the page
+Quote Post
Tajgeer
post 7.02.2010, 20:29:39
Post #2





Grupa: Zarejestrowani
Postów: 290
Pomógł: 48
Dołączył: 11.05.2008
Skąd: Kielce

Ostrzeżenie: (0%)
-----


  1. <?php include('header.php'); ?>
  2. <?php
  3. include('config.php');
  4. $query = mysql_query("SELECT * FROM news;");
  5. while ($rekord = mysql_fetch_assoc($query)) {
  6. echo('<div style="text-align:center;">
  7. <div style="float:left;"><b>'.$rekord['name'].'</b></div>
  8. <div style="float:right;">'.$rekord['date'].'</div>
  9. </div><br />');
  10. $string = nl2br($rekord['text']);
  11. echo("$string");
  12. }
  13. ?>
  14. <?php include('footer.php'); ?>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 24.07.2025 - 21:48