Ik ben met een ontwerp van mijn site in Wordpress bezig. Ik ga een theme vanaf de grond opbouwen.
Nu ben ik bij het ontwerp en ben dit aan het omzetten naar Wordpress thema.
Het thema bestaat nu uit index.php en style.css. Wanneer alles klaar is splits ik het thema in gedeeltes als header, content, footer etc...
Alleen ik heb een heel vervelend probleempje.
Boven en onderaan de pagina heb ik onverklaarbare Margins. Met een X-Ray tooltje ben ik er achter gekomen dat de margin in de Body zit en niet in de Div.
Om dat te bevestigen heb ik de body background even oranje gemaakt. En de header een image background gegeven.
Het zelfde probleem doet zich aan de onderkant voor.
Zowel Safari als Firefox renderen het zelfde.
De oplossing
Body heeft al Margin: 0 en alle Div's ook. Het is ook geen verloren spatie in de code.
Heeft iemand dit ook gehad, en wat is de oplossing?
Website staat online op: www.wvstudios.nl
Nu ben ik bij het ontwerp en ben dit aan het omzetten naar Wordpress thema.
Het thema bestaat nu uit index.php en style.css. Wanneer alles klaar is splits ik het thema in gedeeltes als header, content, footer etc...
Alleen ik heb een heel vervelend probleempje.
Boven en onderaan de pagina heb ik onverklaarbare Margins. Met een X-Ray tooltje ben ik er achter gekomen dat de margin in de Body zit en niet in de Div.
Om dat te bevestigen heb ik de body background even oranje gemaakt. En de header een image background gegeven.
Het zelfde probleem doet zich aan de onderkant voor.
Zowel Safari als Firefox renderen het zelfde.
De oplossing
Cascading Stylesheet:
werkt niet omdat dan de rest van mijn onderdelen niet goed renderen. Maar het probleem word er wel mee opgelost.1
| * { margin: 0; } |
Body heeft al Margin: 0 en alle Div's ook. Het is ook geen verloren spatie in de code.
Heeft iemand dit ook gehad, en wat is de oplossing?
Cascading Stylesheet:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
| /* Theme Name: WV Studios Theme URI: http://www.wvstudios.nl Description: Official WV Studios Theme. Version: 1.0 Author: Werner de Vries Author URI: http://www.wvstudios.nl */ body { margin: 0; font-family: Arial, Helvetica, Georgia, Sans-serif; font-size: 12px; color: #000000; background-color: #fad796; } a:link, a:visited { text-decoration: underline; color: #33669; } a:hover { text-decoration: none; } #wrapper { margin: 0 auto 0 auto; width: 750px; text-align: left; background-color: #f67652; } #header_bar { width: 100%; height: 196px; background: url(images/header_bg.png); } #header { margin: 0 auto 0 auto; width: 750px; height: 196px; } #container { float: left; width: 500px; } .sidebar { float: left; width: 240px; background: #eeeeee; margin: 0 0 0 10px; display: inline; } #footer_bar { clear: both; width: 100%; background-color: #555555; } #footer { margin: 0 auto 0 auto; width: 750px; background-color: #ffffff; } |
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <title><?php bloginfo('name'); ?><?php wp_title(); ?></title> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please --> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_get_archives('type=monthly&format=link'); ?> <?php //comments_popup_script(); // off by default ?> <?php wp_head(); ?> </head> <body> <!-- Begin Header --> <div id="header_bar"> <div id="header"> <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1> </div> </div> <!-- Einde Header --> <div id="wrapper"> <!-- Begin Container --> <div id="container"> <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <div class="entry"> <?php the_content(); ?> <p class="postmetadata"> <?php edit_post_link('Bewerken', ' ', ''); ?> </p> </div> </div> <?php endwhile; ?> <div class="navigation"> <?php posts_nav_link(); ?> </div> <?php else : ?> <div class="post" id="post-error"> <h2><?php _e('Not Found'); ?></h2> </div> <?php endif; ?> </div> <!-- Einde Container --> <!-- Begin Sidebar --> <div class="sidebar"> <ul> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?> <li id="search"> <?php include(TEMPLATEPATH . '/searchform.php'); ?> </li> <?php wp_list_pages('title_li=<h2>Paginas</h2>'); ?> <li><h2><?php _e('Categories'); ?></h2> <ul> <?php wp_list_cats('sort_column=name&optioncount=0&hierarchical=0'); ?> </ul> </li> <?php endif; ?> </ul> </div> <!-- Einde Sidebar --> </div> <!-- Begin Footer --> <div id="footer_bar"> <div id="footer"> <p> Copyright © Werner de Vries </p> </div> </div> <!-- Einde Footer --> </body> </html> |
Website staat online op: www.wvstudios.nl
[ Voor 3% gewijzigd door Saeverix op 22-01-2008 21:47 ]
People who live in glass houses shouldn't throw stones.