Op deze website gebruiken we cookies om content en advertenties te personaliseren, om functies voor social media te bieden en om ons websiteverkeer te analyseren. Ook delen we informatie over uw gebruik van onze site met onze partners voor social media, adverteren en analyse. Deze partners kunnen deze gegevens combineren met andere informatie die u aan ze heeft verstrekt of die ze hebben verzameld op basis van uw gebruik van hun services. Meer informatie.

Akkoord

Vraag & Antwoord

Webdesign (HTML, CSS, Flash)

Iframe in het midden

dropkick
3 antwoorden
  • ik zit met een probleempje;

    ik heb een layout gemaakt, deze wil ik gecentreerd weergeven in een html pagina en dan wil ik een iframe ook gecentreerd en 105px van boven weergeven, hoe doe ik dit?

    layout:
    [img:273f8ea7ea]http://img383.imageshack.us/img383/8014/untitled2xl6.jpg[/img:273f8ea7ea]
    layout met vlak waar het iframe moet komen (witte gedeelte):
    [img:273f8ea7ea]http://img383.imageshack.us/img383/4719/untitled1jd0.jpg[/img:273f8ea7ea]

    en nog eentje zonder text:
    [img:273f8ea7ea]http://img257.imageshack.us/img257/354/untitled3ge0.th.jpg[/img:273f8ea7ea]
  • Waarschijnlijk wil je die iframe omdat je anders in elke afzonderlijke pagina het menu en het nieuws moet verwerken, want dat is veel werk als je iets in het menu bijv. moet veranderen en dan elke pagina moet bijwerken.

    Toch is het niet aan te raden hier een iframe voor te gebruiken, omdat het de indexatie en toegankelijkheid helemaal niet ten goede komt. Beter is om te werken met php-includes, waarbij je de te herhalen code (het menu) in een apart bestandje zet en vervolgens 'include' in je pagina's.
    Vervolgens maak je het met CSS zoals je op CSS Play kunt zien. Maar aangezien je nog geen iframe kunt positioneren, wordt dat wellicht een probleem. Echter, CSS is simpelweg essentieel voor layouts (of je gaat voor houtje-touwtjeoplossingen…). Lees eens Validwebs artikel 'Ik wil ook een site: CSS' voor een introductie.
  • ok, zal kijken, bedankt!

    nog een vraagje:
    hoe zet ik in deze php code een achtergrond afbeelding?

    [code:1:5d71df4065]<?php
    session_start();
    $username = "username";
    $password = "password";

    $january = 'januari';
    $february = 'februari';
    $march = 'maart';
    $april = 'april';
    $may = 'mei';
    $june = 'juni';
    $july = 'juli';
    $august = 'augustus';
    $september = 'september';
    $october = 'oktober';
    $november = 'november';
    $december = 'december';

    $monday = "m";
    $tuesday = "d";
    $wednesday = "w";
    $thursday = "d";
    $friday = "v";
    $saturday = "z";
    $sunday = "z";

    $startwithmonday = true;

    $path = "./";

    $weeknumber = true;

    $width = "50px";

    $numberBGColor = "";
    $numberTextColor ="#000";

    $emptyBGColor = "";
    $emptyTextColor ="#FFF";

    $selBGColor = "#999";
    $selTextColor = "#000";

    $todayBGColor = "#FE05F7";
    $todayTextColor = "#FFFFFF";

    $monthBGColor = "";
    $monthTextColor = "#A7D18D";
    $daysBGColor = "";
    $weekBGColor = "";


    $background = "#FE05F7";

    $event1 = "#EEEEEE";
    $event2 = "#CCCCCC";

    if($startwithmonday) {
    $dayName = array($monday, $tuesday, $wednesday, $thursday, $friday, $saturday,$sunday);
    } else {
    $dayName = array($sunday, $monday, $tuesday, $wednesday, $thursday, $friday, $saturday);
    }

    $monthName = array($january, $february, $march, $april, $may, $june, $july, $august, $september, $october,
    $november, $december);

    if(isset($_GET['act'])){
    $act = $_GET['act'];
    } else {
    $act = "";
    }
    if(isset($_GET['date'])){
    $date = $_GET['date'];
    } else {
    $date = date("Y-m-d");
    }

    echo "<STYLE type=\"text/css\">
    <!–
    .A {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: bold;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    vertical-align: middle;
    text-align: center;
    color: $numberTextColor;
    }

    .sel {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    cursor: default;
    color: $selTextColor;
    background-color: $selBGColor;
    }
    .event {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    cursor: default;
    vertical-align: middle;
    text-align: center;
    color: $numberTextColor;
    }

    .empty {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    cursor: default;
    vertical-align: middle;
    text-align: center;
    color: $emptyTextColor;
    background-color: $emptyBGColor;
    }
    .today {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    cursor: default;
    vertical-align: middle;
    text-align: center;
    color: $todayTextColor;
    background-color: $todayBGColor;
    }";

    if($act == "event") {

    echo
    "table {
    width: 250px;
    border-style: none;
    padding: 0px;
    margin: 0px;
    vertical-align: middle;

    }

    td {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10;
    font-weight: normal;
    font-style: normal;
    text-align: center;
    vertical-align: middle;
    padding: 2 2 2 2;
    text-align: left;
    vertical-align: top;
    vertical-align: middle;

    }
    ";
    } else {
    echo ".table {
    border-style: none;


    border-collapse: $spacing;
    empty-cells: hide;
    }

    .td {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;

    }";
    }
    echo "–>
    </STYLE>

    ";

    function createMonth($date) {

    global $startwithmonday;

    $date = split("\-", $date);
    $year = $date[0];
    $month = $date[1];

    $this_month_date = makeDate($year, $month, 1);
    $last_month_date = makeDate($year, $month - 1, 1);
    $next_month_date = makeDate($year, $month + 1, 1);

    $this_month_first_day = trim(date("w", $this_month_date));

    $this_month_days = trim(date("t", $this_month_date));
    $last_month_days = trim(date("t", $last_month_date));

    $this_month_number = trim(date("n", $this_month_date));
    $last_month_number = trim(date("n", $last_month_date));
    $next_month_number = trim(date("n", $next_month_date));

    $this_month_year = trim(date("Y", $this_month_date));
    $last_month_year = trim(date("Y", $last_month_date));
    $next_month_year = trim(date("Y", $next_month_date));

    if($startwithmonday) {
    if($this_month_first_day == 0) {
    $this_month_first_day = 7;
    }
    } else {
    $this_month_first_day++;
    }


    for($I = 1; $I < $this_month_first_day; $I++) {
    $temp = $last_month_days - $this_month_first_day + $I + 1;
    $monthArray["$last_month_year-$last_month_number-$temp"] = array(0, "$last_month_year-$last_month_number-$temp");
    }
    for($I = 1; $I <= $this_month_days; $I++) {
    $monthArray["$this_month_year-$this_month_number-$I"] = array(1, "$this_month_year-$this_month_number-$I");
    }
    for($I = 1; $I <= 43 - $this_month_days - $this_month_first_day; $I++) {
    $monthArray["$next_month_year-$next_month_number-$I"] = array(0, "$next_month_year-$next_month_number-$I");
    }
    return $monthArray;
    };
    function appendEvent($date, $monthArray) {

    global $path, $act;

    $date = split("\-", $date);
    $year = $date[0];
    $month = $date[1];

    $date = makeDate($year, $month, 1);
    $date = date("Y-m", $date);



    if($act == "event") {
    $fp = @fopen("$date.txt", "r");
    } else {
    $fp = @fopen("$path$date.txt", "r");
    }

    if($fp) {
    while (!feof($fp)) {
    $line = fgets($fp);
    if($line != "") {
    $data = split("\#", $line);
    $date = split("\|", $data[0]);
    $monthArray["$date[0]"][0] = 2;
    $monthArray["$date[0]"][1] = "$date[0]";
    $monthArray["$date[0]"][2][] = array("$date[1]", "$data[1]");
    }
    }
    }
    return $monthArray;
    };

    function addToday($date, $monthArray) {
    $date = split("\-", $date);
    $year = $date[0];
    $month = $date[1];
    $this_year = date("Y");
    $this_month = date("n");

    if($year == $this_year && $month == $this_month) {
    $monthArray[date("Y-n-j")][0] +=2;
    }
    return $monthArray;
    };

    function displayMonth($date, $monthArray) {

    global $path, $weekBGColor, $weeknumber, $width, $monthName, $dayName, $monthBGColor, $monthTextColor, $daysBGColor;

    $date = split("\-", $date);
    $year = $date[0];
    $month = $date[1];

    $this_month = mktime(0, 0, 0, $month, 1, $year);
    $last_month = mktime(0, 0, 0, $month - 1, 1, $year);
    $next_month = mktime(0, 0, 0, $month + 1, 1, $year);

    echo "<script type=\"text/javascript\">
    <!–

    function event(location){

    win=window.open(\"\",\"\",\"height=400,width=280, scrollbars=0, resizable=1, location=0, menubar=0, toolbar=0, status=0 \")
    //win.moveTo(0,0)
    //win.resizeTo(heigh,width)
    win.location=location
    }
    //–>
    </script>

    ";

    echo "<TABLE class=\"table\" cellspacing=\"0\" cellpadding=\"0\" width=\"$width\">
    <TR>
    ";
    echo "<TD class=\"td\" color=\"$monthTextColor\" bgcolor=\"$monthBGColor\" onMouseOver=\"this.className='sel'\" onMouseOut=\"this.className='td'\" >
    <A class=\"A\" HREF=\"?date=";
    echo date("Y-m-j", $last_month);
    echo "\">&laquo;</A>
    </TD>
    <TD class=\"td\" color=\"$monthTextColor\" bgcolor=\"$monthBGColor\">
    ";
    echo $monthName[$month-1];
    echo date(" Y", $this_month);
    echo "
    </TD>
    <TD class=\"td\" color=\"$monthTextColor\" bgcolor=\"$monthBGColor\" onMouseOver=\"this.className='sel'\" onMouseOut=\"this.className='td'\" >
    <A class=\"A\" HREF=\"?date=";
    echo date("Y-m-j", $next_month);
    echo "\">&raquo;</A>
    </TD>
    </TR>
    <TR>
    ";

    echo "<TD class=\"td\" colspan=\"3\">
    <TABLE class=\"table\" width=\"100%\">
    <TR>
    ";

    foreach ($dayName as $key) {
    echo "<TD class=\"td\" bgcolor=\"$daysBGColor\">$key</TD>
    ";
    }
    if($weeknumber) {
    echo "<TD class=\"td\" bgcolor=\"$daysBGColor\">w.</TD>
    ";
    }

    echo "</TR>

    <TR>
    ";

    $day = 0;

    if($weeknumber) {
    $week = date("W", $this_month);
    }


    foreach ($monthArray as $key) {
    $date = split("\-", $key[1]);

    if($key[0] == 0) {
    echo "<TD class=\"empty\">$date[2]</TD>
    ";
    } else if($key[0] == 1) {
    echo "<TD onMouseOver=\"this.className='sel'\" onMouseOut=\"this.className='event'\" class=\"event\">$date[2]</TD>
    ";
    } else if($key[0] == 2) {
    echo "<TD onMouseOver=\"this.className='sel'\" onMouseOut=\"this.className='event'\" class=\"event\"><A class=\"A\" HREF=\"javascript:event('$path?act=event&date=" . $key[1] . "')\">$date[2]</A></TD>
    ";
    } else if ($key[0] == 3) {
    echo "<TD onMouseOver=\"this.className='sel'\" onMouseOut=\"this.className='today'\" class=\"today\">$date[2]</TD>
    ";
    } else if ($key[0] == 4) {
    echo "<TD onMouseOver=\"this.className='sel'\" onMouseOut=\"this.className='today'\" class=\"today\"><A class=\"A\" HREF=\"javascript:event('$path?act=event&date=" . $key[1] . "')\"><B>$date[2]</B></A></TD>
    ";
    }
    $day++;
    if($day >= 7) {
    if($weeknumber) {
    echo "<TD bgcolor=\"$weekBGColor\" class=\"event\">$week</TD>
    ";
    if($week >= 53) {
    $week = 0;
    }
    $week++;
    }
    echo "</TR>
    <TR>
    ";
    $day = 0;
    }

    }
    echo "</TR>
    </TABLE>
    </TD></TR></TABLE>
    ";



    };

    function displayEvent($date, $monthArray) {

    global $event1, $event2 , $monthName;

    $date = split("\-", $date);
    $year = $date[0];
    $month = $date[1];
    $day = $date[2];
    $event = $monthArray["$year-$month-$day"][2];

    echo "<TABLE>
    ";
    echo "<TR>
    <TD bgcolor=\"$event2\"colspan=\"2\">
    ";
    echo $day . " " . $monthName[$month-1] . ", " . $year;
    echo "
    </TD>
    </TR>

    ";
    foreach ($event as $key) {
    echo "<TR>
    ";
    echo "<TD width=\"90px\" bgcolor=\"$event1\">
    ";

    $time = split("\-",$key[0]);
    echo "$time[0]";
    if($time[1] != ":") {
    echo "-$time[1]";
    }

    echo "
    </TD>
    ";
    echo "<TD bgcolor=\"$event1\" width=\"210px\">
    ";
    echo $key[1];
    echo "
    <TD>
    </TR>

    ";
    $temp = $event1;
    $event1 = $event2;
    $event2 = $temp;
    }
    echo "</TABLE>
    ";
    };

    function login() {
    global $username, $password;

    if (isset($_POST['calender_username']) && isset($_POST['calender_password'])) {
    if ($_POST['calender_username'] == $username && $_POST['calender_password'] == $password) {
    $_SESSION['calender_login'] = 1;
    }

    }

    if(isset($_SESSION['calender_login']) && $_SESSION['calender_login'] == 1) {
    ?>

    <form action='./?act=addEvent' method='post' enctype='multipart/form-data' name='login'>
    <table width="200" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td>Year:</td>
    <td>
    <select name="calender_year">
    <option value="2005">2005</option>
    <option value="2006">2006</option>
    <option value="2007">2007</option>
    <option value="2008">2008</option>

    </select></td></tr><tr>
    <td>Month:</td><td>
    <select name="calender_month">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>

    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>

    <option value="11">11</option>
    <option value="12">12</option>
    </select> </td></tr><tr>
    <td>Day:</td><td>
    <select name="calender_day">
    <option value="1">1</option>
    <option value="2">2</option>

    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>

    <option value="9">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>

    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>

    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>

    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select> </td>

    </tr>
    <tr>
    <td>start</td>

    <td>
    <input name='calender_shour' type='text' value='' size='2' maxlength='2' />
    :
    <input name='calender_sminut' type='text' value='' size='2' maxlength='2' />
    </td>

    </tr>
    <tr>
    <td>end</td>

    <td>
    <input name='calender_ehour' type='text' value='' size='2' maxlength='2' />
    :
    <input name='calender_eminut' type='text' value='' size='2' maxlength='2' />
    </td>

    </tr>
    <tr>
    <td colspan="3">
    <textarea name="calender_event" cols="20" rows="3"></textarea>
    </td>
    </tr>
    <tr>
    <td><a class="A" href="javascript:document.login.submit()">Submit</a></td>
    <td colspan="2"><a class="A" href="javascript:document.login.reset()">Reset</A></td>

    </tr>
    </table>
    </form>

    <?php
    } else {

    ?>
    <form action='./?act=add' method='post' enctype='multipart/form-data' name='login'>
    Gebruikersnaam:<BR />
    <input name='calender_username' type='text'
    value='' size='13' maxlength='20' /><BR />
    Wachtwoord:<BR />
    <input name='calender_password' type='password' value=''
    size='13' maxlength='20' /><BR />
    <a class="A" href="javascript:document.login.submit()">Login</a>
    <a class="A" href="javascript:document.login.reset()">Reset</A>
    </form>
    <?php }

    };

    function addEvent() {
    if(isset($_POST['calender_year']) && isset($_POST['calender_month']) &&isset($_POST['calender_day'])) {

    $year = $_POST['calender_year'];
    $month = $_POST['calender_month'];
    $day = $_POST['calender_day'];
    $date = "$year-$month-$day";
    $eventArray = array();
    $eventArray = appendEvent($date, $eventArray);

    $shour = $_POST['calender_shour'];
    $sminut = $_POST['calender_sminut'];
    $ehour = $_POST['calender_ehour'];
    $eminut = $_POST['calender_eminut'];
    $event = $_POST['calender_event'];


    $eventArray["$year-$month-$day"][0] = 2;
    $eventArray["$year-$month-$day"][1] = "$year-$month-$day";
    $eventArray["$year-$month-$day"][2][] = array("$shour:$sminut-$ehour:$eminut", $event);

    echo "Event added!<BR/>";
    echo "<A class=\"A\" HREF=\"./?act=add\">Add new</A> ";
    echo "<A class=\"A\" HREF=\"./\">Return to calender</A>";

    return $eventArray;
    }

    };

    function saveEvents($eventArray) {

    global $path;

    $year = $_POST['calender_year'];
    $month = $_POST['calender_month'];
    $day = $_POST['calender_day'];
    $date = makeDate($year, $month, 1);
    $date = date("Y-m", $date);

    foreach ($eventArray as $day) {
    foreach($day[2] as $key) {
    $data[] = trim("$day[1]|$key[0]#$key[1]");
    }
    }

    sort($data);

    $fp = fopen("$path$date.txt","w");
    if($fp) {
    foreach($data as $key) {
    fwrite($fp, $key . "
    ");
    }
    }
    fclose($fp);
    };

    function makeDate($year, $month, $day) {
    return mktime(0, 0, 0, $month, $day, $year);
    };

    switch($act) {

    case "":
    $monthArray = createMonth($date);
    $monthArray = appendEvent($date, $monthArray);
    $monthArray = addToday($date, $monthArray);
    displayMonth($date, $monthArray);
    break;

    case "add":
    login();
    break;

    case "addEvent":
    $eventArray = addEvent();
    saveEvents($eventArray);
    break;

    case "event":
    $monthArray = createMonth($date);
    $monthArray = appendEvent($date, $monthArray);
    displayEvent($date, $monthArray);
    break;

    default:
    $monthArray = createMonth($date);
    $monthArray = appendEvent($date, $monthArray);
    $monthArray = addToday($date, $monthArray);
    displayMonth($date, $monthArray);
    break;
    }
    ?>[/code:1:5d71df4065]























































Beantwoord deze vraag

Dit is een gearchiveerde pagina. Antwoorden is niet meer mogelijk.