Keyboard Shortcuts

Keyboard shortcuts are available for common actions and site navigation.

Skip to content
  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
tak_dcxi's profile
TAK
TAK
TAK
@tak_dcxi

Tweets

TAK

@tak_dcxi

都内でwebデザイナー&コーダーをしています。26歳になりました。デザインもコードも綺麗に作りたい。フリーでも制作を行っているので機会があればどうぞ。スキル→Photoshop/Illustrator/XD/HTML/EJS/CSS/Sass/JS/PHP/gulp/webpack 学習中→Vue/React

東京都
Joined January 2019

Tweets

  • © 2019 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

  • In this conversation
    Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    TAK‏ @tak_dcxi Aug 8

    以前投稿した初心者向けCSS説明が途中だったので続きです。 【margin,padding】 簡単な説明をするとmarginは要素の外側の余白、paddingは内側の余白です。単位指定はリキッドに対応したい箇所は%かvw、font-sizeによって詰めたり広げたりしたい箇所はemかrem、その他はpxで指定することが多いです

    9:17 PM - 8 Aug 2019
    • 22 Retweets
    • 219 Likes
    • 村上昴平@フリーエンジニア Toru Murakami ひらともや yoshihiro maki おーさわ@フルスタックWeb屋 umeko_umeume まるみ@修正6m+デザイン えびまま@いつもありがとう😊
    1 reply 22 retweets 219 likes
      1. New conversation
      2. TAK‏ @tak_dcxi Aug 8

        marginやpaddingを2方向以上に指定する場合は基本的にショートハンドを使います。指定1つで上下左右全方向、指定2つで上下と左右、指定3つで上と左右と下、指定4つで時計回りです。ここら辺に関してはサルワカさんの説明がめちゃくちゃ上手なのでそちらに投げます…https://saruwakakun.com/html-css/basic/margin-padding …

        1 reply 0 retweets 9 likes
        Show this thread
      3. TAK‏ @tak_dcxi Aug 8

        恥ずかしながら2年ほど前に未経験でこの業界に入ったときはCSSの基本のきすらよく知らなくて全く理解できなかったところなんですが、marginとpaddingの%指定は【左右だけでなく上下も】親要素の横幅を基準とした相対単位です。ですから、上下の値に%を指定しても親要素の縦幅を基準にはできません…

        1 reply 1 retweet 12 likes
        Show this thread
      4. TAK‏ @tak_dcxi Aug 8

        上下を%で指定することはあるの?と前聞かれたことがありますが、リキッドデザイン(ブラウザの横幅に応じてサイトの表示サイズを流動的に変えるデザイン)を組むときは上下の値も%で指定します。

        1 reply 0 retweets 7 likes
        Show this thread
      5. TAK‏ @tak_dcxi Aug 8

        また、paddingの上下どちらかに%指定することで画像やマップをどの横幅から見ても同じ高さで保持するテクニックがあるのですが、これはめちゃくちゃ使います。(ここ参照:https://recooord.org/css-images-trimming/ …)

        1 reply 3 retweets 13 likes
        Show this thread
      6. TAK‏ @tak_dcxi Aug 8

        例えば画像を黄金比でトリミングしたいって時はラッパー(<figure><img></figure>でいうfigure)にpadding-top:61.8%;を指定して、中身のimgはabsoluteで配置し、ラッパーを埋めるようにimgの横縦を調整すればどのデバイスから見ても黄金比で保つことができますね。

        1 reply 1 retweet 11 likes
        Show this thread
      7. TAK‏ @tak_dcxi Aug 8

        参考サイトではラッパーにoverflow:hiddenを使って画像を中央配置でやっていますが、僕は面倒くさいのでimgにwidth:100%,height:100%;top:0;left:0;を指定した後にobject-fit:cover;を指定しています。object-fitの説明はここ(https://www.webcreatorbox.com/tech/object-fit )を参照

        1 reply 0 retweets 8 likes
        Show this thread
      8. TAK‏ @tak_dcxi Aug 8

        object-fitはとても便利なプロパティなのですが、IEは未対応なのでIEでも使えるようにobject-fit-imagesというJSプラグインを利用します。説明サイトにも載っています。個人的にはプラグインを導入してでも使いたいプロパティです。

        1 reply 0 retweets 4 likes
        Show this thread
      9. TAK‏ @tak_dcxi Aug 8

        また、marginにはpaddingと違って「相殺」と「ネガティブマージン」という2つの有名な特徴があります。相殺はサルワカさんの記事でも説明されていましたが、要素Aのmargin-bottomと、次に隣接した要素Bのmargin-topが並ぶと大きい値のmarginが優先されて小さいmarginが潰されるという事案です。

        1 reply 0 retweets 4 likes
        Show this thread
      10. TAK‏ @tak_dcxi Aug 8

        marginの相殺は左右のmarginでは発生せず、また例外的にfloatのかかった要素、親要素にoverflow:hiddenもしくはborder,paddingが加えられた要素でも上下のmarginの相殺が起こりません。こういうこともあって全体的にmarginの上下はどちらか一つに統一するというのが個人的な暗黙のルールです。

        1 reply 0 retweets 5 likes
        Show this thread
      11. TAK‏ @tak_dcxi Aug 8

        基本的にはmargin-topで揃えた方がメンテナンス性があがるのでそっちの方がいいかもしれません。(ここ参照:https://qiita.com/rhirayamaaan/items/78544723724ccc2a50e9 …)

        1 reply 0 retweets 8 likes
        Show this thread
      12. TAK‏ @tak_dcxi Aug 8

        「ネガティブマージン」は値にマイナス値を指定することで余白を設けるのではなく逆に詰めるテクニックです。流行りのブロークングリッドレイアウトなんかで要素を重ねるときに使いますね。

        1 reply 0 retweets 6 likes
        Show this thread
      13. TAK‏ @tak_dcxi Aug 8

        margin-top:-64px;とretativeのtop:-64px;やtransform:translateY(-64px);の違いは64px詰めて動かすか、元あった位置を基準に要素を64px縦に移動させるかの違いです。relativeやtranslateで移動させると元々要素があるはずだった範囲に余白が空いたままになります。

        1 reply 0 retweets 5 likes
        Show this thread
      14. TAK‏ @tak_dcxi Aug 8

        TAK Retweeted TAK

        ネガティブマージンのテクとして別の方がツイートしていたコンテナを突き破って要素を画面いっぱいに広げるcalc(50% - 50vw)があります。これは以前にも僕もツイートしました(https://twitter.com/tak_dcxi/status/1138821953857261568?s=20 …)

        TAK added,

        TAK @tak_dcxi
        横幅固定で中央寄せしているコンテナの中の一部のコンテンツをウィンドウの横幅いっぱいまで広げたいって時は広げたいブロックに margin: 0 calc(50% - 50vw);…
        Show this thread
        1 reply 2 retweets 8 likes
        Show this thread
      15. TAK‏ @tak_dcxi Aug 8

        正確にはcalc((100% - 100vw) / 2)です。仕組みとしては親要素(100%)の幅から画面いっぱい(100vw)を引くと画面の端から親要素までの隙間をネガティブマージンによって引き延ばすことができるので、それを左右のマージンに適応するからcalc(100% - 100vw)を2等分してcalc(50% - 50vw)って感じです。

        1 reply 1 retweet 7 likes
        Show this thread
      16. TAK‏ @tak_dcxi Aug 8

        理屈は簡単なんですが説明が下手ですいません…。別の方のツイートには無かったので補足なのですが、画面いっぱいまでつきやぶった要素の中身はコンテナ幅で揃えたいって時は引いた数値分だけパディングで余白を作ればいいです。paddingの左右にcalc(50vw - 50%)を指定すれば完璧です。

        1 reply 0 retweets 6 likes
        Show this thread
      17. TAK‏ @tak_dcxi Aug 8

        ただこのやり方だと横スクロールバーを生み出すのでbodyなどにoverflow-x:hidden;を指定しておきましょう。 個人的には背景だけ広げたい場合には疑似要素で背景作ってabsoluteで相対配置後のwidth:100vw;left:calc(50% - 50vw);で指定しています。仕組みはleft:50%;transform:translateX(-50%);と同じ

        1 reply 0 retweets 6 likes
        Show this thread
      18. TAK‏ @tak_dcxi Aug 8

        また、position:fixedを使った固定ヘッダーを使うとページ内リンクの位置がヘッダの高さ分重なってしまいます。これを阻止したい場合はネガティブマージンで高さをヘッダー分ずらして、ずらした分paddingで余白を作るといい感じになりますね。(https://www.tam-tam.co.jp/tipsnote/html_css/post4776.html …)

        1 reply 1 retweet 18 likes
        Show this thread
      19. TAK‏ @tak_dcxi Aug 8

        説明めちゃ下手で申し訳ないですが、marginとpaddingだけでも突き詰めていくと奥が深いというお話でした。需要があったらwidthとheightも説明したいと思います…widthの指定値「min-content」「max-content」「fit-content」は結構マイナーですが案外役に立ったりします。IEとEdgeでは使えませんが😅

        1 reply 1 retweet 25 likes
        Show this thread
      20. End of conversation

    Loading seems to be taking a while.

    Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

      Promoted Tweet

      false

      • © 2019 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Cookies
      • Ads info