Foros del Web » Creando para Internet » HTML »

Problema al traducir un archivo XHTML a HTML5

Estas en el tema de Problema al traducir un archivo XHTML a HTML5 en el foro de HTML en Foros del Web. Hola amigos. Resulta que el día de ayer inicie la traducción del tema que utiliza mi blog de Wordpress a HTML5 (originalmente estaba en XHTML). ...
  #1 (permalink)  
Antiguo 25/06/2012, 08:59
Avatar de mykeura  
Fecha de Ingreso: julio-2010
Ubicación: Guatemala
Mensajes: 46
Antigüedad: 13 años, 9 meses
Puntos: 6
Problema al traducir un archivo XHTML a HTML5

Hola amigos.
Resulta que el día de ayer inicie la traducción del tema que utiliza mi blog de Wordpress a HTML5 (originalmente estaba en XHTML).
Ahora el problema con el que me he encontrado. Es que al cambiar la etiqueta <span></span> por <p></p> mi diseño se rompe.
La verdad, no estoy seguro si el error lo comento al sustituyo la etiqueta <span>. O cuando cambio <div> por <section>. Así que por eso aque les dejo el código que estoy pasando a html5.

Original
Código PHP:
<?php get_header(); ?>

    <?php if ( have_posts() ) : ?>
        <?php while ( have_posts() ) : the_post(); ?>

        <div class="content-title">
            <?php the_category(' <span>/</span> '); ?>
            <a href="http://facebook.com/share.php?u=<?php the_permalink() ?>&amp;t=<?php echo urlencode(the_title('',''false)) ?>" target="_blank" class="f" title="Share on Facebook"></a>
            <a href="http://twitter.com/home?status=<?php the_title(); ?> <?php echo getTinyUrl(get_permalink($post->ID)); ?>" target="_blank" class="t" title="Spread the word on Twitter"></a>
            <a href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink() ?>&amp;title=<?php the_title(); ?>" target="_blank" class="di" title="Bookmark on Del.icio.us"></a>
            <a href="http://stumbleupon.com/submit?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('',''false)) ?>" target="_blank" class="su" title="Share on StumbleUpon"></a>
        </div>

        <div class="entry">
            <div <?php post_class('single clear'); ?> id="post_<?php the_ID(); ?>">
                <div class="post-meta">
                    <h1><?php the_title(); ?></h1>
                    by <span class="post-author"><a href="<?php echo get_author_posts_urlget_the_author_meta'ID' ) ); ?>" title="Posts by <?php the_author(); ?>"><?php the_author(); ?></a></span> on <span
                        class="post-date"><?php the_time(__('M j, Y')) ?></span> &bull; <span><?php the_time() ?></span> <?php edit_post_link__'Edit entry'), '&bull; '); ?><a
                        href="#comments" class="post-comms"><?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments'), ''__('Comments Closed') ); ?></a></div>
                <div class="post-content"><?php the_content(); ?></div>
                <div class="post-footer"><?php the_tags(__('<strong>Tags: </strong>'), ', '); ?></div>
            </div>
            <div class="post-navigation clear">
                <?php
                    $prev_post 
get_adjacent_post(false''true);
                    
$next_post get_adjacent_post(false''false); ?>
                    <?php if ($prev_post) : $prev_post_url get_permalink($prev_post->ID); $prev_post_title $prev_post->post_title?>
                        <a class="post-prev" href="<?php echo $prev_post_url?>"><em>Previous post</em><span><?php echo $prev_post_title?></span></a>
                    <?php endif; ?>
                    <?php if ($next_post) : $next_post_url get_permalink($next_post->ID); $next_post_title $next_post->post_title?>
                        <a class="post-next" href="<?php echo $next_post_url?>"><em>Next post</em><span><?php echo $next_post_title?></span></a>
                    <?php endif; ?>
                <div class="line"></div>
            </div>
        </div>

        <?php endwhile; ?>
    <?php endif; ?>

<?php comments_template(); ?>

<?php get_footer(); ?>
Traducido a HTML5
Código PHP:
<?php get_header(); ?>
    <?php if ( have_posts() ) : ?>
        <?php while ( have_posts() ) : the_post(); ?>
        <section class="content-title">
            <?php the_category(' <span>/</span> '); ?>
            <a rel="nofollow" href="http://facebook.com/share.php?u=<?php the_permalink() ?>&amp;t=<?php echo urlencode(the_title('',''false)) ?>" target="_blank" class="f" title="Compártelo en Facebook"></a>
            <a rel="nofollow" href="http://twitter.com/home?status=<?php the_title(); ?> <?php echo getTinyUrl(get_permalink($post->ID)); ?>" target="_blank" class="t" title="Corre la voz en Twitter"></a>
            <a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink() ?>&amp;title=<?php the_title(); ?>" target="_blank" class="di" title="Agrégalo a Del.icio.us"></a>
            <a rel="nofollow" href="http://stumbleupon.com/submit?url=<?php the_permalink() ?>&amp;title=<?php echo urlencode(the_title('',''false)) ?>" target="_blank" class="su" title="Compártelo StumbleUpon"></a>
        </section>
        <section class="entry">
            <section <?php post_class('single clear'); ?> id="post_<?php the_ID(); ?>">
                <div class="post-content" class="post-meta">
                    <h1><?php the_title(); ?></h1>
                    Por <span class="post-author"><a href="<?php echo get_author_posts_urlget_the_author_meta'ID' ) ); ?>" title="Escrito por <?php the_author(); ?>"><?php the_author(); ?></a></span> en <span
                        class="post-date"><?php the_time(__('M j, Y')) ?></span> &bull; <span><?php the_time() ?></span> <?php edit_post_link__'Editar artículo'), '&bull; '); ?><a
                        href="#comments" class="post-comms"><?php comments_number(__('Sin Comentarios'), __('1 Comentario'), __('% Comentarios'), ''__('Comentarios Cerrados') ); ?></a></div>
                         <article class="post-content"><?php the_content(); ?>
                         <?php if (function_exists('nrelate_related')) nrelate_related(); ?>
            </article>              
        <footer class="post-footer"><?php the_tags(__('<strong>Tags: </strong>'), ', '); ?></footer>
            <div class="post-navigation clear">
                <?php
                    $prev_post 
get_adjacent_post(false''true);
                    
$next_post get_adjacent_post(false''false); ?>
                    <?php if ($prev_post) : $prev_post_url get_permalink($prev_post->ID); $prev_post_title $prev_post->post_title?>
                        <a class="post-prev" href="<?php echo $prev_post_url?>"><em>Artículo anterior</em><span><?php echo $prev_post_title?></span></a>
                    <?php endif; ?>
                    <?php if ($next_post) : $next_post_url get_permalink($next_post->ID); $next_post_title $next_post->post_title?>
                        <a class="post-next" href="<?php echo $next_post_url?>"><em>Artículo siguiente</em><span><?php echo $next_post_title?></span></a>
                    <?php endif; ?>
                <div class="line"></div>
            </div>
        </section>
        <?php endwhile; ?>
    <?php endif; ?>
  <?php comments_template(); ?>
<?php get_footer
(); ?>
Por cierto, el tema de Wordpress se llama: Sight
  #2 (permalink)  
Antiguo 25/06/2012, 13:59
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 9 meses
Puntos: 1532
Respuesta: Problema al traducir un archivo XHTML a HTML5

<span> y <p> no son iguales ni equivalentes, <p> es un atributo en bloque display: block; mientras que <span> es de línea display: inline;

de hecho ¿de donde sacaste que <span> debe ser reemplazado por <p> o viceversa?: el uso de las etiquetas semánticas es una cosa, pero los <div> y <span> nunca cambiaron, se pueden seguir usando.

otra cosa, no creo que un <section> dentro de <section> sea semántico, hay muchas discusiones sobre el tema, como:

<section><article>1</article><article>2</article></section>
o viceversa:
<article><section>1</section><section>2</section></article>

pero no secciones dentro de secciones ¿?
__________________
¡Por favor!: usa el highlight para mostrar código
El que busca, encuentra...

Etiquetas: html5, traducir, xhtml
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:17.