Gå til innhold

News problem: Title vil ikke line up med teksten


Anbefalte innlegg

Hei!

 

Er i full gang med min nye blogg og har nå kommet til det første problemet :S Som vist på bildet under vil titelen ikke line up med teksten under - hva er problemet css masters?

 

wrong.jpg

 

PS: Har ikke full kontrol på css :p - bare rett css'en hvis det er feil :)

 

/* Text, News*/
a {
color: #C7E813;
font-size: 11px;
background-color:transparent;
text-decoration: none;
font-family: "Trebuchet MS";
}

pre {
color: #564b47;
font-size: 11px;
background-color: #fefefe;
}

p,h1,h3,pre {
padding: 2px 4px;
margin: 0px;
font-family: "Trebuchet MS";
}

h3 {
font-size: 28px;
color: #8FA10D;
font: "Trebuchet MS";
}

h2 {
font-size: 11px;
color: #004A5F;
background-color: transparent;
font-family: "Trebuchet MS";
padding: 0px 0px;
}

/* END */

Lenke til kommentar
Videoannonse
Annonse

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Thinkstyle.</title>

<style type="text/css" media="all">@import "stylesheet.css";</style>

</head>

 

<body>

<div id="header"></div>

<div id="container">

<div id="hoved">

<?PHP

include("fork/show_news.php");

?></div>

  <div id="meny">

  <p class="meny">HOVEDSIDEN</p>

  <p class="meny">meg selv </p>

  <p class="meny">PortfØlje</p>

  <p class="meny">webutvikling</p>

  <p class="meny">galleriet</p>

  <p class="meny">downloads</p>

  <p class="meny">linker</p>

  <p class="meny">kontakt</p>

</div>

</div>

</body>

</html>

 

 

Der vettu :thumbup:

Lenke til kommentar
Ikke akkurat den jeg var ute etter..

Siden der alle "nyhetene postet"..

 

Kansje vise oss: show_news.php

Nei, det vil hvert fall ikke gjøre oss noe godt.

 

Gå inn på sida di via nettleseren din etter at du har lasta opp filene til serveren som støtter php. Derretter går du via nettleseren til --> Vis --> Kildekode. Sikker noe annet i IE.

Lenke til kommentar

Hvor er dine h1- og h2-elementer? Du kan ikke begynne rett på h3.

 

Forslag: Lag en <h1>Thinkstyle</h1> og skjul den i css med display:hidden.

 

Feilen har nok med at h3 og p er paddet like mye, men i tillegg ligger p-elementet inni en div, som sikkert har en eller annen form for margin og/eller padding.

 

Sett div { margin:0;padding:0;} i CSS-filen og se hvordan det blir.

Lenke til kommentar

  Hvor er dine h1- og h2-elementer? Du kan ikke begynne rett på h3.

 

Forslag: Lag en <h1>Thinkstyle</h1> og skjul den i css med display:hidden.

 

Feilen har nok med at h3 og p er paddet like mye, men i tillegg ligger p-elementet inni en div, som sikkert har en eller annen form for margin og/eller padding.

 

Sett div { margin:0;padding:0;} i CSS-filen og se hvordan det blir.

 

kan du forklare hvor jeg skal legge de forskjellige tingene ?

 

sorry, er no0b på css... :(

Lenke til kommentar

Du bør fjerne:

 

height: 400px;

 

fra

 

#container {
width: 592px;
height: 400px;
margin: 0 auto;
background: #FFFFFF;
border-left: 10px solid #FFFFFF;
border-right: 10px solid #FFFFFF;
border-bottom: 10px solid #FFFFFF;
}

 

Så den plutselig ikke stopper når det blir for mye innhold :)

 

Også fjern:

padding: 0px 0px;

fra

h2 {
font-size: 11px;
color: #004A5F;
background-color: transparent;
font-family: "Trebuchet MS";
padding: 0px 0px;
}

 

Se hvordan det funker da :)

Lenke til kommentar

Sånn der ! :)

 

<?PHP

error_reporting (E_ALL ^ E_NOTICE);

$cutepath =  __FILE__;
$cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath);
$cutepath = preg_replace( "'/show_news\.php'", "", $cutepath);

require_once("$cutepath/inc/functions.inc.php");
require_once("$cutepath/data/config.php");

//----------------------------------
// Check if we are included by PATH
//----------------------------------
if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
elseif(eregi("show_news.php", $PHP_SELF)){
die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br>
This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br>
this is <font color=red>WRONG</font> :   <?PHP include(\"http://yoursite.com/cutenews/show_news.php\"); ?><br>
this is <font color=green>CORRECT</font>:   <?PHP include(\"cutenews/show_news.php\"); ?><br>
<br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>");
}
//----------------------------------
// End of the check
//----------------------------------

if(!isset($subaction) or $subaction == ""){ $subaction = $POST["subaction"]; }

if(!isset($template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); }
else{
if(file_exists("$cutepath/data/${template}.tpl")){ require_once("$cutepath/data/${template}.tpl"); }
   else{ die("Error!<br>the template <b>$template</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is"); }
}

// Prepare requested categories
if(eregi("[a-z]", $category)){
die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"$category\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br>
   example:<br><blockquote><?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\");<br>?></blockquote>");
}
$category = preg_replace("/ /", "", $category);
$tmp_cats_arr = explode(",", $category);
foreach($tmp_cats_arr as $key=>$value){
   if($value != ""){ $requested_cats[$value] = TRUE; }
}

if($archive == ""){
$news_file = "$cutepath/data/news.txt";
$comm_file = "$cutepath/data/comments.txt";
}else{
$news_file = "$cutepath/data/archives/$archive.news.arch";
$comm_file = "$cutepath/data/archives/$archive.comments.arch";
}

$allow_add_comment  	= FALSE;
$allow_full_story  	= FALSE;
$allow_active_news    = FALSE;
$allow_comments    = FALSE;

//<<<------------ Detarime what user want to do
if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or $requested_cats[$ucat] == TRUE) ){
   if($subaction == "addcomment"){ $allow_add_comment	= TRUE; $allow_comments = TRUE; }
   if($subaction == "showcomments") $allow_comments = TRUE;
if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes") $allow_full_story = TRUE;
if($subaction == "showfull") $allow_full_story = TRUE;
if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE;

}
else{
   if($config_reverse_active == "yes"){ $reverse = TRUE; }
$allow_active_news = TRUE;
}
//----------->>> Detarime what user want to do

require("$cutepath/inc/shows.inc.php");

unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives);
?>
<!-- cutenews http://cutephp.com/ /-\ aj-fork http://appelsinjuice.org/?vis=cutenews-aj -->

Lenke til kommentar

Det ser ut som du har noen problmer med bl.a div article som vises i kildekoden for siden din, men som ikke finnes i CSS arket ditt. Det virker på meg som du har brukt deler av AJ-fork example og at det ikke er samsvar mellom det som er kodet i html og det som er kodet i CSS.

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...