He Pai-Pai to Kaituhi Blog Blog?

Tā CSS

Ka rite ki taku whakaoti i te pou o nanahi on Pāpāho ROI, I hiahia ahau ki te tuku tirohanga ki a ia ki te Kaiwhakahaere Matua o Dotster Wharangi Clint. I taku taarua ki te PDF, ahakoa, he koretake te whaarangi!

He maha tonu nga taangata kei reira e hiahia ana ki te taarua i nga kape o te paetukutuku ki te tohatoha, ki te tohutoro a muri ake, ki te konae ranei me etahi tuhinga. I whakatau ahau kei te hiahia ahau ki te hanga i taku tuhinga tuhi-hoa. He maamaa ake tena i taku i whakaaro ai.

Me pehea te whakaatu i to Putanga Taa:

Me maarama koe ki nga kaupapa o CSS hei whakatutuki i tenei. Ko te mea uaua rawa ko te whakamahi i te papatohu kaiwhakawhanake a to tirotiro hei whakamatautau i te whakaatu, huna, me te whakatika i nga korero kia taea ai e koe te tuhi i to CSS. I Safari, me whakahohe e koe nga taputapu kaiwhakawhanake, paatohia te taha matau ki to whaarangi ka kowhiria Tirohia te Ihirangi. Ma tera e whakaatu ki a koe te waahanga me te CSS e hono ana.

He pai rawa atu te kowhiri a Safari ki te whakaatu i te tuhinga taarua o to whaarangi ki te kaitirotiro paetukutuku:

Safari - Tirohia te Tirohanga i te Kaititiro Paetukutuku

Me Pehea te Hanga i to Kaituhi Blog Blog-Friendly:

He ruarua nga huarahi hei tohu i to taera hei taarua. Ko tetahi ko te taapiri noa i tetahi waahanga ki to raarangi taera o tenei wa e motuhake ana ki te momo papaaho o te "taarua".

@media print {
     header, 
     nav, 
     aside { 
         display: none; 
     }
     #primary { 
         width: 100% !important 
     }
     .hidden-print, 
     .google-auto-placed, 
     .widget_eu_cookie_law_widget { 
         display: none; 
     }
}

Ko tetahi atu huarahi ko te taapiri i tetahi pepa taera motuhake ki to kaupapa tamaiti e whakaatu ana i nga waahanga taarua. Anei me penei:

  1. Tukuna he pepa taapiri taapiri ki to raarangi kaupapa i karangahia tā.css.
  2. Taapirihia he korero ki te raarangi taapiri hou i to functions.php konae Me mahara koe kua utaina to konae taarua.css whai muri i to raarangi maatua me to tamaiti kia utaina ai nga taera. I whakanohoia e ahau he kaupapa matua 100 mo tenei utanga kia utaina ana i muri i te monomai Tenei te ahua o taku korero:

function theme_enqueue_styles() {
    global $wp_version;
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
    wp_enqueue_style( 'child-style-print', get_stylesheet_directory_uri() . '/print.css', array(), $wp_version, 'print' );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' , 100);

Ka taea e koe te whakarite i te konae print.css ka whakarereke i nga waahanga katoa e hiahia ana koe kia huna kia whakaatuhia kia rereke ranei. Kei taku papaanga, hei tauira, ka huna e ahau nga whakaterenga katoa, nga pane, nga taha taha, me nga hiku kia pai ai nga tuhinga e hiahia ana ahau ki te whakaatu.

My tā.css penei te ahua o te konae. Panui kua taapirihia atu e au nga taapiri, he tikanga e manakohia ana e nga kaitirotiro hou:

header, 
nav, 
aside { 
    display: none; 
}
#primary { 
    width: 100% !important 
}
.hidden-print, 
.google-auto-placed, 
.widget_eu_cookie_law_widget { 
    display: none; 
}

He pehea te Tirohanga o te Tirohanga

Anei me penei taku tirohanga taarua mena ka taia mai i Google Chrome:

Tirohanga Panui WordPress

Whakahoahoa Taarua Taarua

He mea nui kia kite atu kaore nga kaitirotiro katoa i waihangahia kia rite. Akene ka hiahia koe ki te whakamatautau i ia kaitirotiro kia kitea he pehea te ahua o to whaarangi. Kei te tautoko etahi i etahi waahanga whaarangi whakamua hei taapiri i nga korero, whakanoho i nga taha me nga rahi o te whaarangi, me etahi atu waahanga. Smashing Magazine he tino tuhinga taipitopito mo enei tuhinga roa kōwhiringa.

Anei etahi taipitopito whakatakotoranga whaarangi i whakauruhia e au hei taapiri i te whakahua mana pupuri i te maui o raro, he papanga whaarangi i te taha matau o raro, me te taitara tuhinga kei te taha maui o runga o ia whaarangi:

@page { 
    size: 5.5in 8.5in;
    margin: 0.5in; 
}
@page:right{ 
  @bottom-left {
    margin: 10pt 0 30pt 0;
    border-top: .25pt solid #666;
    content: "©  " attr(data-date) " DK New Media, LLC. All Rights Reserved.";
    font-size: 9pt;
    color: #333;
  }

  @bottom-right { 
    margin: 10pt 0 30pt 0;
    border-top: .25pt solid #666;
    content: counter(page);
    font-size: 9pt;
  }

  @top-right {
    content:  string(doctitle);
    margin: 30pt 0 10pt 0;
    font-size: 9pt;
    color: #333;
  }
}

2 Comments

  1. 1
  2. 2

He aha koutou whakaaro?

Whakamahia ai e tenei pae i te Akismet hei whakaiti i te mokowhiti. Akohia te tukatuka o to raraunga korero.